dedoz
12 Feb 2012, 7:09 AM
to execute a code after more than one store is loaded (asyn) i use
(this code is just an example)
store1 = Ext.create('StoreType1');
store2 = Ext.create('StoreType2');
store3 = Ext.create('StoreType3');
store1.load{callback: allStoresReady(); }
store2.load{callback: allStoresReady(); }
store3.load{callback: allStoresReady(); }
function allStoresReady ()
{ if ( store1.isLoading() || store2.isLoading() || store3.isLoading() ) return;
... execute some code after all stores are ready .....
}
is this the right way to go ?
(this code is just an example)
store1 = Ext.create('StoreType1');
store2 = Ext.create('StoreType2');
store3 = Ext.create('StoreType3');
store1.load{callback: allStoresReady(); }
store2.load{callback: allStoresReady(); }
store3.load{callback: allStoresReady(); }
function allStoresReady ()
{ if ( store1.isLoading() || store2.isLoading() || store3.isLoading() ) return;
... execute some code after all stores are ready .....
}
is this the right way to go ?