1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    midodjo is on a distinguished road

      0  

    Default Unanswered: tree store append child

    Unanswered: tree store append child


    I populate a tree panel with a static treeStore that not have a specific model or reader(i don't need server to populate the store becauce i populate dynamicly).when i try to append child to the root for example with this syntax:
    expressionsStore.getRootNode().appendChild({ leaf:false,
    text:'hello',
    name:'test',
    param:'param3',
    isParam:true
    })
    the node is added but the raw property of the childNode is undifined and i can't access to the property 'param' for example.Any body has an idea to resolve this problem?thx

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    115
    Answers
    346
    vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold

      0  

    Default


    You should use a model or at least use fields config to include all fields you need for a node.
    Code:
    var store = Ext.create('Ext.data.TreeStore', {
       fields: [{
          name: 'text', type: 'string'
       },{
           name: 'name', type: 'string'
       },{
           name: 'param', type: 'string'
       },{
           name: 'isParam', type: 'boolean' 
       }],
       ...
    });

Thread Participants: 1