Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: TreeView Gadget refresh

  1. #1

    TreeView Gadget refresh

    Hi,

    2 questions.

    1. What is the best way to refresh a treeview gadget?

    for my tree items property I have
    Code:
    select custname,locaddress1,conttype from v_custlocationsbycustomer where custid = {v_customers.custid}
    I have the same type of code in my grid gadget and it refreshes automatically as the value for {v_customers.custid} changes.

    Does a tree need an explicit refresh somewhere?

    2. Is it possible to manually populate a treeview gadget ?

    Thanks.

    Herb

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,841
    Hi Herb,

    2. You have access to the choicelist property - Lianja.get("mytreeviewgadget").choicelist.

    Not sure on the refresh - you could set choicelist to "" then back to the select statement, but there may be a better way of doing that.

    Yvonne

  3. #3
    Hi Yvonne,

    I prefer to handle the population manually.
    Do you happen to know if could specify a particular Icon for a particular row?
    Meaning - Something like a red X next to an inactive customer and a green arrow for one paid in full.

    Herb

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,162
    Blog Entries
    22
    If you have specified that the first column should be a checkbox you can add items like this manually and the checkbox will be checked or unchecked.

    theTreeView.addListItem("+caption", row, col)
    theTreeView.addListItem("-caption", row, col)

    In other words you prefix the caption with a "+" or a "-" to check/uncheck the checkbox.

    Withe regards to manually refreshing.

    theTreeView.clear()
    theTreeView.addItems("select * from theworld")

    should do the trick. If you are grouping by columns in the tree just order the sql select and specify the column list in the sql select.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Hi Barry,

    I am getting the following while trying to clear my Treeview Gadget

    otree.clear() ^
    METHOD 'clear' not found

    Thanks.

    Herb

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,162
    Blog Entries
    22
    Hmm thats strange. Let me look into it as the method is there for clear().

    Also Herb fyi, I have now added CheckListView as a gadget and OptionGroup as an advanced control. These should be available in tomorrows build.

    The way this works is that you can bind it to either a numeric column or a character column. If bound to a character column it is stored as a comma separated list of selected items e.g. if the "choice list" is "Apples,Oranges,Bananas" and you select Oranges and Bananas then the column will be updated as "2,3".

    As you navigate the data the CheckListView checkboxes are updated to reflect the value of the bound data column value.

    This makes it quite easy to have a "todo" list or a checklist as a gadget in a form section or canvas section. Setting the exclusive attribute on the OptionGroup or in the gadget attributes causes it to operate like a traditional OptionGroup with radio buttons. If a caption is specified then the checkboxes/radiobuttons will be contained within a traditional GroupBox.

    I've also added some additional theming functionality as below. All done with CSS skinning.

    Name:  Screen Shot 2013-07-10 at 5.27.41 PM.jpg
Views: 114
Size:  156.7 KB
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Barry - I am running out of accolades

    Herb

    ps - It looks like some of the other methods in the treeview gadget may not have been exposed.
    I am getting the same type of error for additems

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,162
    Blog Entries
    22
    I'll take a look they should all be.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,162
    Blog Entries
    22
    This is now fixed in the next build.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,162
    Blog Entries
    22
    Quote Originally Posted by hmischel@diligentsystems.com View Post
    Barry - I am running out of accolades

    Herb

    ps - It looks like some of the other methods in the treeview gadget may not have been exposed.
    I am getting the same type of error for additems
    This now fixed in the next build.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us