1
votes

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?

1

1 Answers

1
votes

I happened to spot this issue in the forums the other day: http://www.sencha.com/forum/showthread.php?151211-Reloading-TreeStore-adds-all-records-to-store-getRemovedRecords

Looks like this is currently an open issue. Someone has attached a fix on the forums that you might try, though.