Search code examples
extjsnodesexpandtreenodetreepanel

extjs treepanel: expand() & expandChildNodes()


If I write:

rootNode.expand()

I can only get access to the children nodes of this rootNode, but can't get access to the grandchildren nodes of this rootNode. I have to write:

rootNode.expandChildNodes()

in order to acheive it.

Is there another way to obtain the grandchildren or further children nodes even if the tree is collapsed? other than using node.eachChild() function? I tried:

rootChildNode.firstChild

but it doesn't work.


Solution

  • ExtJS 4x has expandAll() method on the Tree Panel component. This will expand every node recursively.