View Full Version : Way to keep store from sending removed records to server?

10 Apr 2014, 12:47 PM
I have a store which is created from a hasMany field and doesn't have its own proxy. The store is tied to a grid which the user can delete rows and the Save button is enabled because the store is dirty. Hitting the Save button sends the removed records to the server which I don't want in this case. Is there a way to tell the store to not send removed records?

As a workaround I tried doing this on Save but then then the parent model didn't think the store was dirty which causes other problems.

Ext.Array.erase(store.removed, 0, store.removed.length);

Any ideas?

10 Apr 2014, 2:00 PM
Touch has a syncRemovedRecords config decides to record.destroy(), or me.removed.push(record) .. but I do not see this in Ext.

Perhaps you could implement something like this in Ext.data.Store :: remove to prohibit them in the first place.

Note sure why removed.length = 0 affects the state unless there is another check.

11 Apr 2014, 4:16 AM
I've also tried store.removed.length = 0 and while that keeps the removed records from being sent to the server it also makes the store think it isn't dirty which I need.