Combo box initial value

I have a combo box that obtains data from url ( url:‘myData.do’), i am setting an initial value but it doesn’t pick it up, then i try with setValue after initializing but it doesn’t work either, the only way i found is by doing a setValue inside a setTimeout of 1 second to wait until combo is loaded and then setValue is executed, i think this is not the correct way because if myData.do is very slow, the combo would be uninitialized, Is there any other way to initialize this kind of combos?

Hi,

The value should be set after data are loaded. However, loading is async. For this reason you need to set value from loading end handler - onXLE event.
Combo options are loaded into the list inside popup. Therefore, you need to onXLE event handler for this list. It can be done as follows:

dhx.ui({

{ view:“combo”, id:‘comboId’,…},

});

$$(“comboId_list”).attachEvent(“onXLE”,function(){
$$(“comboId”).setValue(…);
})

I will try this, thanks