Results 1 to 4 of 4

Thread: [2.2.1] childNodes in Ext.tree.TreeNode doesn't work

  1. #1
    Ext User
    Join Date
    Dec 2008
    Posts
    2
    Vote Rating
    0
      0  

    Default [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.

  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    please define "doesn't work".

    please refer also to the guidelines for posting in Bugs: https://www.sencha.com/forum/showthread.php?t=13985

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    The property for child nodes is called 'children' and not 'childNodes'.

  4. #4
    Sencha User
    Join Date
    Feb 2011
    Posts
    1
    Vote Rating
    0
      0  

    Thumbs up 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •