PDA

View Full Version : tree store append child



midodjo
16 Nov 2012, 2:31 AM
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

vietits
16 Nov 2012, 4:41 PM
You should use a model or at least use fields config to include all fields you need for a node.


var store = Ext.create('Ext.data.TreeStore', {
fields: [{
name: 'text', type: 'string'
},{
name: 'name', type: 'string'
},{
name: 'param', type: 'string'
},{
name: 'isParam', type: 'boolean'
}],
...
});