-
25 Mar 2009 6:47 PM #1
[2.2.1] childNodes in Ext.tree.TreeNode doesn't work
[2.2.1] childNodes in Ext.tree.TreeNode doesn't work
Ext version:2.2.1
Code:var rootNode=new Ext.tree.TreeNode({ id: 'rootNode', text: 'root', expanded: true, childNodes:[{text:'hello'},{text:'world'}] }); var tree = new Ext.tree.TreePanel({ id:'menuPanel', root: rootNode });Last edited by mystix; 25 Mar 2009 at 6:54 PM. Reason: post code in [code][/code] tags.
-
25 Mar 2009 6:55 PM #2
please define "doesn't work".
please refer also to the guidelines for posting in Bugs: http://www.sencha.com/forum/showthread.php?t=13985
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
25 Mar 2009 10:43 PM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
The property for child nodes is called 'children' and not 'childNodes'.
-
21 Feb 2011 4:48 AM #4
the right answer
the right answer
use
var newNode = new Ext.tree.TreeNode({
id: nodeData.id,
text: nodeData.text,
expanded: true,
leaf : false
});
newNode.appendChild(nodeData.childNodes)
where nodeData is the JSON object


Reply With Quote