How to insert a new record to a store
Hi there,
i defined a store
Code:
Ext.define( 'App.store.general.MyStore' , {
extend: 'Ext.data.Store',
autoLoad: true, fields: ['display', 'value'], name: 'myStore', storeId: 'myStore',
proxy: {
type: 'ajax', url:'myUrl',
extraParams: { ... },
reader: {
type: 'json', root: 'data', idProperty: 'value'
}
}
});
in my Application I create this store via
Code:
var store = Ext.create( 'App.store.general.MyStore', {} );
so far everything works fine, the store is loaded and used within a combobox.
now I want to add a new record to the store and I tried
Code:
store.add({ display: 'abc', value: '0' });
and
Code:
store.insert( 0, { display: 'abc', value: '0' });
since the data of the loaded store start their values from 1-15 I thought 0 or 16 should work but there simple happens nothing. No error, no new entry.
What am I doing wrong?
Best
Speedy