Expand up

13 views
Skip to first unread message

tnike1

unread,
Jan 5, 2009, 11:40:21 AM1/5/09
to mootree

I've added a little method to the MooTreeNode class that you might
find usefull.
Its goal is to make a particular node visible by opening all its
parents.

If you need to preselect a node, you then do :
selectednode.expandup(); tree.select(selectednode);

To have it visible and selected.

Have fun!


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// To insert in the MooTreeNode Class definition
expandup: function(){
var node=this.parent;
while(node.id!=null){ node.open=true; node.update();
node=node.parent; }
},
Reply all
Reply to author
Forward
0 new messages