Skip to main content

addOption()

adds a new item into the list of Combobox options

addOption(value: string): void;

Example

const combobox = new dhx.Combobox("combo_container");
combobox.data.parse(dataset);

combobox.addOption("Georgia");

// check that the new item is added into the data collection
console.log(combobox.data.serialize());
note

The method invokes the beforeAdd and afterAdd events of the Data Collection object. If the beforeAdd event returns false, a new item won't be added into the data collection.

Change log:

added in v.7.3