Skip to main content

newOptions

Optional. Allows end users to add new options into the data collection of Combobox

newOptions?: boolean;

Default value: false

Example

const combobox = new dhx.Combobox("combo_container", {
multiselection: true,
newOptions: true
});

Related sample: Combobox. Multiselection, add new options (free text), select all button

The end user can add a new item into the data collection in two ways:

  1. by entering a new value into the input and pressing "Enter"
  2. by entering a new value into the input and selecting the appeared Create "newValue" option in the drop-down list
note

When a user enters a new value into the input, the combobox 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 v7.3

Related article

Editable combobox