How to load sync combo stores in Extjs


var combo = Ext.componentQuery.query('form combobox') /*this fetch all combos that are child of this form (global)*/

var comboCount = len = combo.length; /*the number of combos that are in the form*/
var i = 0;

/*mask it while loading*/ยด
/*this will mask all form*/
component.setLoading(true);

for(; i < len; i++) {
combo[i].getStore().load({
scope: this,
callback: function(recs, operation, success) {
comboCount--;
if(!comboCount) {
/*do what ever you need*/
/*close mask cause all stores in combo are loaded*/
component.setLoadind(false);
}
}
});
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s