I write a method to select a item,why dhtmlcombo don’t have “setSelected” mehtod?
// myself setSelect(value);
dhtmlXCombo.prototype.setSelect = function(val){
var v_text;
if(val==null || val == “” || val==“null”){
this._selOption = null;
this.setComboValue(null);
this.setComboText("");
}else{
for(var i=0; i<this.optionsArr.length; i++)
if(this.optionsArr[i].value == val) {
v_text = this.optionsArr[i].text;
this._selOption = this.optionsArr[i];
this.setComboValue(val);
this.setComboText(v_text);
}
}
}
Combo has
a) combo.selectOption(index) to select option by index
b) combo.setComboValue(value) to select option by value
There was a error in older version, when setComboValue not selected related option - it is fixed in latest version.
thank you ! I will download the last version and try setComboValue.