Rank: Advanced Member Groups: Member
Joined: 9/6/2007 Posts: 133
|
I could not find this in the documention or demos... Is there a way to make a treeview expand or collapse all when a user clicks a link? Client side.
Thank you.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You can do something like this:
<a href="javascript:eo_GetObject('TreeView1').getTopGroup().getItemByIndex(0).setExpanded(true);">expand root node</a>
The above sample expand a TreeView's root node. You can also expand a child node like this:
eo_GetObject('TreeView1').getTopGroup().getItemByIndex(0).getSubGroup().getItemByIndex(3).setExpanded(true);
The above code expands the first top level node's fourth child node.
If you want to expand all parent nodes as well, you can call expandPath. Currently there is no "expandAll" function though.
Thanks
|