Reputation: 1213
I have a grid with several stores.. Some of the stores are linked to certain grids and stores that contain selects they are linked too...
i'd like to refresh all stores if i add / edit / delete a record in certain stores..
I currently have hardcoded my store names, but i like to transform this to a dynamic method, since i want my store names to be dynamic...
I can't seem to find out how to get a list so i can loop through the stores and reload them, or just reload them with a singe command...
Upvotes: 1
Views: 182
Reputation: 3124
If all of your stores have an identifier, you could use Ext.data.StoreManager.each() to loop through all the registered stores.
If you're using MVC, however, a better approach might be to announce the firing of a custom, global event that could be listened to within your controllers, which could then manage the refreshing on a component-by-component level. The advantage of this would be you would have more granular control over which stores are getting reloaded, as opposed to the brute force of using StoreManager.each().
Upvotes: 1