There's a set of operations you can apply to the Combo options. You can find the list of them below:
To add options to Combo, use the addOption method:
myCombo.addOption(options);
The method takes a list of options that should be added to Combo. The type of the options parameter may differ. Please, check the related samples.
Related sample: Script - single option
Related sample: Script - array of arrays
Related sample: Script - array of objects
To delete an option, use the deleteOption method:
myCombo.deleteOption(value);
The method takes the option's value as a parameter.
To update an option, use the updateOption method:
myCombo.updateOption(oldvalue,value,text,css);
The parameters are:
To select an option in the Combo, use the selectOption method:
myCombo.selectOption(ind);
It takes the index of the option in question as a parameter.
To unselect a selected option, use the unSelectOption method:
myCombo.unSelectOption();
To get the selected value option, use the getSelectedValue method:
myCombo.getSelectedValue();
It returns the value of the selected item as a string.
To get the text of the selected option, use the getSelectedText method:
myCombo.getSelectedText();
To get the text set in Combo editor, use the getComboText method:
myCombo.getComboText();
To set text into the Combo editor, use the setComboText method:
myCombo.setComboText(text);
As a parameter, it takes a new text to be set into the Combo editor.
Back to top