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)
- Root Node #2
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?