PDA

View Full Version : Loop all stores from a controller



tdobberphul
6 Dec 2013, 5:37 AM
Hello guys,

does some know how I can access all stores from inside an controller?
I tried:


/* inside a controller function */
this.stores.each(function(store){
store.load();
//and some other things as well
});

But it didn't work.

Thanks a lot,
Tobias

scottmartin
6 Dec 2013, 6:31 AM
You could use something like this:



var stores = Ext.data.StoreManager.map;

for (name in stores) {
if (stores.hasOwnProperty(name)) {
store = stores[name];
store.load();
}
}

tdobberphul
6 Dec 2013, 7:06 AM
Works.
Thanks a lot.

Happy St Nicholas' Day,
T (http://dict.leo.org/#/search=Day&searchLoc=0&resultOrder=basic&multiwordShowSingle=on)obias