i am using extjs 4.0.7. I am implementing Ext.data.TreeStore in my app. I am showing this data on TreePanel. I have also the cutome menu to add node. When i load treeStore dynamically by store.load() method it deletes all the data from database. My Store code is:
Ext.define('Overdrive.store.BomTree', {
extend: 'Ext.data.TreeStore',
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'BomTree',
autoLoad:true,
proxy: {
type: 'rest',
url: '/abc',
reader: {
type: 'json',
idProperty: 'oid'
},
writer: {
type: 'json',
successProperty: 'success'
},
headers: {
'Content-type': 'application/json',
'Accept': 'application/json'
}
},
fields: [
{
name:'id'
},
{
name: 'qty'
},
{
name:'oid'
},
{
name:'parent_id'
},
{
name:'text'
}
]
}, cfg)]);
}
});
The store is loading data first time as expected. Can anybody tell me that What should be the problem?