-
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.
-
16 Sep 2012 5:05 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
Can I get a test case?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Nov 2012 7:16 AM #3
I am for example trying to do the following, and the sync() method is not called either.
Code:// grab settings var store = Ext.getStore('SettingsStore'); var storeLocal = Ext.getStore('SettingsStoreLocalStorage'); store.load({ callback : function(records, operations, success) { storeLocal.add(store.first()); } }); storeLocal.sync({ callback : function() { console.log('syncing local storage'); } });
-
19 Nov 2012 11:43 AM #4
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote