Expand Tree Branches for Selected Nodes

181 views
Skip to first unread message

McCarvill

unread,
Jul 2, 2012, 10:34:35 AM7/2/12
to dyna...@googlegroups.com
I have a four level tree an I want to expand the parent folders of selected nodes when the tree is loaded. I have found some code but have not go it working corretly. So far I have the code below, any advice would be much appreciated.

onPostInit: function(isReloading, isError) {
 
var nodes = [];
 
var nodes = $("#treeCC").dynatree("getSelectedNodes");
 
if(nodes) {
 $
.each(nodes, function() {
 nodes
.visitParents( function (nodes) {
 nodes
.toggleExpand();
 
},true);
 
 
}); //cloae each    
 
}  //close if
 
} //close postInit

Shawn Crane

unread,
Jul 2, 2012, 9:44:22 PM7/2/12
to dyna...@googlegroups.com
Hi, 

You could try:

node.makeVisible()
Expand all parents as neccessary, to make this node visible.

Cheers,
Shawn
Reply all
Reply to author
Forward
0 new messages