Load Multi stores in Extjs @sencha

Example on how to load several stores at a time, framework Extjs @sencha.


var store1 = Ext.create('Ext.data.Store', {
fields: [...],    storeId: 'store1',
...,
autoLoad: {
callback: 'displayWindow'
}
});

var store1 = Ext.create('Ext.data.Store', {
fields: [...],    storeId: 'store2',
...,

autoLoad: {
callback: 'displayWindow'
}
});

var storesIdIndexes = ['store1', 'store2'];

displayWindow: function() {
var allStoresLoaded = true;

// check if all combo stores have been loaded
Ext.each(myComboStores, function(storeId) {
var store = Ext.getStore(storeId);
allStoresLoaded &= store.isLoading();
});

// if all combo stores have been loaded, display your window
if (loaded) {
// display the window
}
}

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