I\'m trying to detect and remove those fields that after a sync are still on the store but are not added to the database (success: false). Then, return an error message to t
This is, if you ask me, some design flaw in ExtJS.
AbstractStore has onCreateRecords, onUpdateRecords, and onDestroyRecords, which are empty functions you can override. You can call rejectChanges() if success is false there.
Ext.define('BS.store.Users', {
extend: 'Ext.data.Store',
model: 'BS.model.User',
autoSync: true,
autoLoad: true,
proxy: {
type: 'direct',
api: {
create: Users.Create,
read: Users.Get,
update: Users.Update,
destroy: Users.Delete,
},
reader: {
type: 'json',
root: 'data',
},
},
onCreateRecords: function(records, operation, success) {
console.log(records);
},
onUpdateRecords: function(records, operation, success) {
console.log(records);
},
onDestroyRecords: function(records, operation, success) {
console.log(records);
},
});