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);
},
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…