In a tree structure like this
var rootNode = { id: 'root', text : 'Root Node', expanded : true, children : [ { id : 'c1', text : 'Child 1', leaf : true }, { id : 'c2', text : 'Child 2', leaf : true }, { id : 'c3', text : 'Child 3', children : [ { id : 'gc1', text : 'Grand Child', children : [ { id : 'gc11', text : 'Grand Child 1', leaf : true }, { id : 'gc12', text : 'Grand Child 2', leaf : true } ] } ] } ] }; var tree = new Ext.tree.TreePanel({ id: 'treePanel', autoscroll: true, root: rootNode });
How to add a node child of any node (say, "grandson")?
I can access the child by going through the root of the tree, but I console it in Firebug, it has no functions. Sorry for the unformatted code, I could not format it.
source share