PDA

View Full Version : Manage asynch store call



ananthbhaskar
15 Nov 2011, 10:54 PM
Hi,

I have two modules in an application, each modules [A & B] are in separate TAB. Both the tab using a common search control to search for data and the respective store will be loaded. I want to disable search & reset button in the common control during loading and enable after stores are loaded.

29321

Both stores are loading asynchronously. if the A module store loaded first then it will enable the buttons, while B module is still loading the data.

I need need to enable the search and reset buttons after A& B module stores are loaded.

Any help on this issue is highly appreciated!!

Thanks,

ananthbhaskar
16 Nov 2011, 6:12 PM
Please share your view, if you come across similar kind of situation.

ananthbhaskar
28 Nov 2011, 12:41 AM
Hi Sencha team, Could you please help me on the above mentioned situation.

Can anyone share the example for isLoading ()example on Ext.data.Connection.

Thanks!!

darthwes
28 Nov 2011, 6:59 AM
Something like:



function twoLoad (store1, store2, cmpArr) {
var i, len;
for(i = 0, len = cmpArr.length; i < len; i++) {
cmpArr[i].disable();
}
store1.load({
callback: function () {
store2.load({
callback: function () {
for(i = 0, len = cmpArr.length; i < len; i++) {
cmpArr[i].enable();
}
}
});
}
});
}
}