PDA

View Full Version : tree panel- collapse



shahrzad
9 May 2010, 4:08 AM
hi friends,

my problem is collapse all subtrees.

In tree panel, when we expand a node and then expand its childs, after collapsing that parent node and then expanding it , those children nodes which expanded before, show them expand... how I can reload tree with all nodes(include their children) collapse?


Thanks alot,
shahrzad

Animal
9 May 2010, 6:20 AM
reload and collapse are two different operations.

Both are documented clearly enough for you to do what you need.

shahrzad
9 May 2010, 8:49 PM
please say me how?
thanks for your reply

Animal
9 May 2010, 9:00 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.tree.TreeNode&member=collapse

shahrzad
9 May 2010, 9:54 PM
hi,
;)
treePanel.on('collapsenode', function(node){
if( !node.isLeaf() ) {

for( i = 0; i < node.childNodes.length; i++ ) {
node.collapse(deep=true);
}

}

it works!
thanks alot