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

Expand on Demand

2 Answers 128 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 2
Shawn asked on 01 Jul 2012, 02:37 AM
Does the TreeView support Expand-on-Demand?  If so could you please provide an example of how to implement this?  If not, do you have any idea by when we can expect this feature?

2 Answers, 1 is accepted

Sort by
0
Iwhp
Top achievements
Rank 1
answered on 13 Aug 2012, 12:00 PM
Same issue here.
I have a TreeView with a HierarchicalDataSource. When using Drag&Drop, the control seems not to work properly, since not all data is yet available. I tried to intercept and using the expand method. But using the expand method does not initiate a "get Data" for the HierarchicalDataSource...
0
Iwhp
Top achievements
Rank 1
answered on 14 Aug 2012, 06:25 AM
Found that toggle does behave differently than expand.
If one uses toggle with a HierarchicalDataSource, the node gets filled with the data and expanded.

The following sample uses the select-event, and toggles the node. If the data is not yet loaded, it will first get the data, if the data is load, it just toggles between expand and collapse...

treeview.bind("select", function (e) {
   treeview.toggle(e.node);
});
Tags
TreeView
Asked by
Shawn
Top achievements
Rank 2
Answers by
Iwhp
Top achievements
Rank 1
Share this question
or