9 Nov 2012 4:46 AM #1
Answered: Problem with order of store beforeload event and assigning store to data view
I've got a problem where store "beforeload" event is fired before the store is attached to a List view and thus loading mask is not displayed at all.
In Ext.Application#launch method I'm calling store.load(). My main view (tab.Panel) that is displayed when app is loaded has a List view. Because I'm using the same List view in a few places, but with different data, the store of the List view is assigned in List view "initialize" event handler.
This causes store "beforeload" event to be fired before the store is assigned to the view and thus loading mask is not displayed.
Is there some way to fix it?
You can check if the store is loading (store.isLoading()) in initialize and if it is then mask the list
12 Nov 2012 8:32 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
You can check if the store is loading (store.isLoading()) in initialize and if it is then mask the listMitchell 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 firstname.lastname@example.org
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.
12 Nov 2012 12:37 PM #3
I added this check when "painted" event is triggered and and just call dataview.onBeforeLoad() if it's true. Default dataview.onBeforeLoad handler checks if the view is painted, that's why I listen to "painted" event.