Extjs combobox displayField/valueField issue

We get an issue while we set the value of combobox in extjs
As per the API : 
selectByValueString valueBoolean scrollIntoView ) : Boolean
Select an item in the dropdown list by its data value. This function does NOT cause the select event to fire. The sto...
Select an item in the dropdown list by its data value. This function does NOT cause the select event to fire. The store must be loaded and the list expanded for this function to work, otherwise use setValue.

But sometimes this fails. A quick fix to this is using callback: function() inside load
var val = 3;
var store = comboC.getStore();
store.load({
   callback: function() {
      comboC.setValue(val);
   }
});



0 comments: