Ext 4.1.1: Add new record to Store

Viewed 48957
2 Answers

For a panel you can add or remove items by remove() and add()

var store = Ext.create('MyApp.store.Roles', {autoLoad: false});
store.load(function(records, action, success) {
    if (success) {
        store.remove(store.findRecord('id', 50, 0, false, true, true));//exact match
        store.add({'id':110,'name':'Agent' });
    }
});
Related