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
FYI: Sequence of events when updating a record (ExtJs 5.0.1)
Scenerio 1
javascript executes
record.set('some data') // Store has autoSync: true, The database will succeed
'update' event fires (operation = 'edit')
'beforesync' event fires
network traffic occurs database returns a success (json)
'update' event fires (operation = 'commit')
'onUpdateRecord' method runs
Scenerio 2
javascript executes
record.set('some data') // Store has autoSync: true, The database will fail
'update' event fires (operation = 'edit')
'beforesync' event fires
network traffic occurs database returns a failure (json)
'onUpdateRecord' method runs and calls rejectChanges()
'update' event fires (operation = 'reject')
'exception' event fires
Two Notes: a) the last update and onUpdateRecord are reversed and b) if the onUpdateRecord does not call rejectChanges() the following 'update' event is not fired. This will leave the record in a dirty state which means that subsequent sync() will send it.
For record.add() the events are similar however I see that the 'add' event is not fired. The Ext documentation for the event says that it is fired but the same documentation does not say that the add() method will fire the event.