exception - Extjs 4.1 remove from store after successfully removed from the server -
exception - Extjs 4.1 remove from store after successfully removed from the server -
i have situation need delete items store, using remove(record) method , goal remove item store after server deletes , returns success message. store uses ajax proxy create delete phone call server , using both autoload , autosync. when remove(record) called first removes record store , proceeds create delete phone call server.
i find behavior bit unusual because seems have manually reinsert model store based on server's response. makes situation more complex 'exception' event beingness handled proxy , not store. proxy store agnostic catching exception event generated server's response in proxy, not allow me perform operations rejectchanges on store.
obviously there's wrong implementation's logic, need understand how alter store after server responds , based on server's response or if that's not possible how homecoming store previous state before operation.
i utilize "exception" event of proxy that. example:
store.getproxy().on({ exception: function() { store.rejectchanges(); } })
also can added on store:
initcomponent: function() { this.callparent(arguments); this.getproxy().on({ exception: function(proxy, response, operation) { this.rejectchanges(); } }); }
exception extjs proxy handler store
Comments
Post a Comment