PDA

View Full Version : Make load synchronous for JsonStore



jaidengre
15 Oct 2010, 5:17 AM
I am using a JsonStore.load call. I need to make this call as synchronous. I do not want to move the post processing to a handler or callback as I have different code flows and I have different components. Is there a way to make the load synchroous only for a particular JSonStorr (All other stores in my system still need to work in asynchronous mode)

Please help...

menuStore = new Ext.data.JsonStore({
// store configs
autoDestroy: true,
autoLoad: false,
url: globalTypeUrl,
storeId: 'typeStore',
// reader configs
idProperty: 'internalValue',
fields: ['internalValue', 'imagePath', 'displayValue', {
name: 'checked',
type: 'boolean'
},
'parentType', {
name: 'allowMultiSelection',
type: 'boolean'
},
{
name: 'attributePanel',
type: 'boolean'
},
'callback', {
name: 'enabled',
type: 'boolean'
},
'enableIcon', 'disableIcon', 'toolTip']
});



later somewhere I call
menuStore.load();

Please advice on how to make the above load call as synchronous.

Animal
15 Oct 2010, 5:38 AM
You must do it in a load handler or callback.

Do not be scared. I assume the "different code flows" you want to do after load is performed by functions.

So just call those functions from your load handler or callback.