11 Oct 2012 6:35 AM #1
Stores do not load their own records if events are suppressed for them
A store will not load its own records into its data member if events are suppressed.
The store uses the onDataRefresh event to trigger loading the records into data. It will properly return the records to the callback registered during the .load() call, but will not load them internally.
SDK Version 22.214.171.124
It happens in data/Store.js, on line 1901 in the onProxyLoad method. If the proxy was successful, it attempts to fire the 'datarefresh' event. It also sends a callback with that firing that should have been called after all the event handlers (Store.doDataRefresh). However, if you trace into the mixin/Observable class fireAction and then doFireEvent, we find that the method returns immediately if events are suppressed, not bothering to call the registered callback.
12 Oct 2012 6:29 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
IMO this is an application issue, you shouldn't have the store's events suspended when trying to take action like this.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
14 Oct 2012 7:05 PM #3
That's a short-sighted answer. There are plenty of reasons one might want to suppress events while a store is loading -- for instance, if a DataView is tied to a store and you don't want the dataview to refresh right away.
Regardless, the way it currently performs is undocumented, and feels like a bug. There shouldn't be anything that a typical use of the API could do that would cause a store to *appear* to be successful at loading its records (including returning "success" to the callback) but still not internally load the records.
How do I get this reported as a bug so that it can be addressed?