Results 1 to 2 of 2

Thread: tree store append child

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
      0  

    Default 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 User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    116
      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' 
       }],
       ...
    });

Posting Permissions

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