Extjs treepanel: expand () & expandChildNodes ()

If I write:

rootNode.expand()

I can only access the child nodes of this rootNode, but I cannot access the grandchildren of this rootNode. I have to write:

rootNode.expandChildNodes()

to get it.

Is there any other way to get grandchildren or further child nodes, even if the tree crashed? other than using a function node.eachChild()? I tried:

rootChildNode.firstChild

but that will not work.

+5
source share
3 answers

ExtJS 4x has a method expandAll()on a tree panel component. This will recursively expand each node.

+2
source

if you want to go to the partial level, then in this case:

           expandTo:function(level){

                    treePanel.collapseAll();
                    treePanel.getRootNode().cascadeBy(function (node) {

                          if (node.getDepth() < level) { node.expand(); }
                          if (node.getDepth() == level) { return false; }
                     });
         }
0

- node.expand(true), node - node. , node . node.

0

All Articles