PDA

View Full Version : How can I expand the tree-level after getting the level number?



Kishan.Srinivas
16 Mar 2009, 8:17 PM
Hi,
I am working on column tree.



{
id:'plus',
on:{
click: function(){
var selectedNode = tree.getSelectionModel().getSelectedNode();
var selectedLevel = selectedNode.getDepth();

Ext.each(selectedNode, function(childNodes) {
selectedLevel .expand();
});

}
}

}



What I actually need is,depending on the level(say level2) in which I am in,all the child nodes of the corresponding level should open up.
i.e.

-1
+1.1
+1.2
+1.3
-2
+2.1
+2.2
+2.3

Suppose if 'm in level 2(+1.1, 1.2.......), and I say "Expand One" should open the child nodes of 1.1, 1.2, 1.3 and 2.1, 2,2, 2.3.

Suppose if 'm in level 3(+1.1.1, 1.1.2.......), and I say "Expand One" should open the child nodes of 1.1.1, 1..12, 1.1.3 and 2.1.1, 2.1.2, 2.1.3.