combobox - ExtJS - second combo-box not getting populated after choosing first one -


I have two dependent combo boxes and the value of the second is chosen for the first time. / P>

For this, I am using the set value for the second combo box on the selected event of the first one.

There are two cases of code below, here case 1 does not work but case 2 works in IE9:

  Case1: This selection does not work: Function (Combo, record) {Ext.getCmp ('voyageMonitoritngVesselCode'). Store.load (); // loading the second combo box, the 'voyageMonitoritngVesselCode' store. SetValue (record [0] .data.vslCd); // Set the value in the second combo box Case2: Select this works: Function (combo, record) {Ext.getcmp ('voyagemonitoritngvesselcode'). Store.load (); // Load the second combobox alert (record [0] .data.vslCd); // The only difference in both cases is this line Ext.getCmp ('VoyageMonitoritngVesselCode'). SetValue (record [0] .data.vslCd); // Setting the value in the second combo box   

That is, when I write a warning statement between loading the store and setting the value, the value is displayed in the second conbocobox , But if I leave this warning then there is no value set in the combobox.

I thought maybe the time required to load the store and it may be by preventing alert messages at this time but as a solution for this, I automatically load: the second combo Is not right, so that the store does not have to load, but still the case was similar - the value was not set without alert

Browser - IE9

ExtJS - 4 < / P>

Thanks in advance.

The second does not work because the load is an asynchronous request, which means that when you press the tree To set the value, before setting the warning, it gives enough tme to load ... a quick fix:

  var combo = Ext.getCmp ('voyageMonitoritngVesselCode'); Combo.store.load ({callback: function (R, option, success) {combo.setValue (record [0] .data.vslCd);}});    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -