Check documentation for the latest version 6.0 of dhtmlxSuite updateOption DHTMLX Docs

updateOption

updates the specified option in the combo box

void updateOption(string oldvalue,string value,string text,string css);

Parameters

oldvaluestringthe current option's value
valuestringa new option's value
textstringa new option's text
cssstringa new style for the option

Example

var myCombo = new dhtmlxCombo("combo_zone3","alfa3",200);
myCombo.addOption([
    {value: "a", text: "option A", img_src: "../images/red.gif", css:"color:red;"}, 
    {value: "b", text: "option B", img_src: "../images/green.gif"}, 
    {value: "c", text: "option C", img_src: "../images/blue.gif"}
]);
...
myCombo.updateOption("b","b","New option B","color:green;");

Back to top