Search code examples
sencha-touchsencha-touch-2

Sencha Touch store sync callback


My store.sync() can return success:false, and if it does, I would like to use something similar to Ext's failure callback to react to the error appropriately, but I did not find a possibility to use any builtin ST functions for this. sync has neither callback nor success nor failure option available in ST.

What did I overlook?

PS: I did find a workaround for success callback at Why is there no sync callback in Sencha Touch? but I need failure callback.


Solution

  • I am now calling Ext.data.Model.save() on all Ext.data.Model instances that are dirty. This won't batch everything neatly together, but in 90% of the cases, only one item is edited anyways. The best is that this allows to check for failure on each and every item, and not only on the whole batch.