I have several stores in my application. They are not created until I load my grid which should call store.load() function. So some components may have a need of stores that are still not created. I am using this function to fix this problem:
getOrCreateStore: function(storeId, className){
return (Ext.getStore(storeId) == undefined) ? Ext.create(className) : Ext.getStore(storeId);
},
So each time component has a need of specific store, I call if created or create it if it doesn't exist.
Is there a better way create the stores so that I don't have to manually do it? Are there some configurations I have missed to set up in my ExtJS 4 application regarding creation of stores?
Why I use the above fix is that grids stay empty if the store is not actually created first.