This is a migrated thread and some comments may be shown as answers.

Reload Items

2 Answers 84 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
digitall
Top achievements
Rank 1
digitall asked on 19 Apr 2011, 01:49 AM
I am building a treeview control which has X number of root nodes (from a database), each of which contain two static nodes which themselves contain Y number of dynamic nodes. Something like this:

  • Root Node #1 (database-driven)
    • Child Node #1 (static)
      • Sub Node #1 (database)
      • Sub Node #2
    • Child Node #2 (static)
      • Sub Node #3 (database)
  • Root Node #2
    • Child Node #3 (static)
      • Sub Node #4 (database)

I have implemented loading on demand for items at the "Child Node" level so it would automatically pull the sub-items when that node is expanded (using ServerSideCallBack) which works great. I have also implemented a context menu for each "Child Node" entry that has an "Add Category" option which adds a new item (at the Sub Node level) so a new entry can be added. This entire process works great and is surprisingly versatile.

The only issue I have is when the new item is added I want all the "Sub Node" entries for the parent "Child Node" item to be re-bound so the items appear in alphabetical order. I tried using the set_expanded() methods but it seems once a node has been expanded the items are cached and there isn't a way to forcefully tell it to go get the items again. Basically I'm looking for a client-side method call that tells the "Child Node" entry that it needs to go get a fresh copy of items once the adding process is complete.

Any idea on how to make this happen?

2 Answers, 1 is accepted

Sort by
0
digitall
Top achievements
Rank 1
answered on 21 Apr 2011, 01:57 AM
Anyone?
0
digitall
Top achievements
Rank 1
answered on 21 Apr 2011, 03:59 AM
Tags
TreeView
Asked by
digitall
Top achievements
Rank 1
Answers by
digitall
Top achievements
Rank 1
Share this question
or