PDA

View Full Version : Store with autoSave:true doesn't auto-save



js_coder
11 Jan 2010, 12:17 PM
Ext.onReady(function() {
store = new Ext.data.JsonStore({
url: '/accounts',
autoLoad: true,
autoSave: true,
restful: true,
writer: new Ext.data.JsonWriter(),
listeners: {
load: function(store) {
// Does nothing
store.remove(store.query().first());
// Fires the DELETE action
store.execute('destroy', store.query().first());
}
}
});
});
Am I missing something? I thought that with autoSave set to true, the remove call in the load handler would immediately cause the store to save and thus fire the DELETE action.