PDA

View Full Version : callback on load or the load event on store fires before data is available



namrms
31 Jan 2013, 6:41 AM
I want to see if a particular value exists in a store after the load of the store is complete.

I tried to do the same both in the load event of the store as well as in the callback function but both the load event and callback seem to be firing much before the data is actually available.

Ex : JStore.load(
{callback:function(){ val='xyz';
if( JStore.find('platformname',val)==-1 ){
alert('Please choose a valid Platform from the drop down');
}
}});
though the store does contain the value 'xyz' , JStore.find('platformname',val) returns -1 . If the same is tried after some delay it doesnt return -1. So I am suspecting that callback is fired much before the data is available.

Same is the case if I check the condition in load event/listener of the store :

is there some event that gets fired when the data is ready for the combo ?

Uisng ext version 4.0.0


But looks like both

mitchellsimoens
31 Jan 2013, 10:54 AM
I see you are using 4.0.0, have you tried a newer release as 4.0.0 is 2 years old now.