1. #1
    Ext User
    Join Date
    Dec 2008
    Posts
    2
    Vote Rating
    0
    qubic is on a distinguished road

      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
    mystix will become famous soon enough

      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
    112
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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
    capture_the_star is on a distinguished road

      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