Threaded View
-
13 Sep 2012 1:12 PM #1
Callback on store's sync() method does not occur after the batch is complete
Callback on store's sync() method does not occur after the batch is complete
I'm not entirely sure what event actually results in the callback, but the store's sync method appears to fire the callback before the sync is complete. In our example, a batch operation of multiple creates fires the callback before all records have been created and returned from the database. So:
Causes the event "mystore.completed" to be fired BEFORE the set of records are done. I was able to get around this by adding this to the proxy of the model used:Code:myStore.sync({ callback: function() { MyApp.App.fireEvent('mystore.completed'); } });
Then, I just call mystore.sync();Code:proxy: { onBatchComplete: function() { MyApp.App.fireEvent('mystore.completed'); } }
To me, this is a problem with the functionality of sync()'s callback.
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote