setting selected value of combobox

Is there a way to set the currently selected value of a combo box using text. I have a text value that I get from a grid and I want to set the value of the combobox using that text (not the value).



Let’s say I get the text “RED” from a column in a row selected on a grid and I want cause a “color” combobox to automatically select RED. I don’t know the value associated with RED so I can’t do it by value. I only have the text.



I tried setComboText and setComboValue and they did not help me out.



Thanks,

Mike


setComboValue allows to select option by value (not by text). So, you can try to use the following approach:


var option= combo.getOptionByLabel(“RED”);


var val = option.value;


combo.setComboValue(val);