It took us years to find the right solution for this. Finally, we added a listener to the write event in the repository, which seems to work correctly. Since this is often necessary, it has been added to the storage prototype as
Ext.data.Store.prototype.syncWithListener = function(onWriteComplete, syncMethod) { this.on('write', onWriteComplete, this, {single:true}); var syncResult = syncMethod ? syncMethod.apply(this) : this.sync(); if (syncResult.added.length === 0 && syncResult.updated.length === 0 && syncResult.removed.length === 0) { this.removeListener('write', onWriteComplete, this, {single:true}); onWriteComplete(this); } return syncResult; };
source share