extjs treepanel: expand() & expandChildNodes()

Simon picture Simon · Apr 14, 2011 · Viewed 15.1k times · Source

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.

Answer

dbrin picture dbrin · Oct 25, 2012

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