Combo
An input that works as an advanced select box with a set of options. It can show suggestions while the user types.
Related sample: Form. All controls
Related sample: Form. Combo
Adding Combo
You can add a Combo control during form initialization:
const form = new dhx.Form("form_container", {
rows: [
{
type: "combo",
name: "combo",
label: "count",
labelPosition: "left",
multiselection: true,
selectAllButton: true,
value: [
"id_1",
"id_2"
],
data: [
{ value: "1", id: "id_1" },
{ value: "2", id: "id_2" },
{ value: "3", id: "id_3" },
{ value: "4", id: "id_4" },
{ value: "5", id: "id_5" }
]
}
]
});
Properties
View the full list of Combo configuration properties.
Working with Combo
You can manage a Combo control with the methods and events of the object that the getItem() method returns.
For example, you can get the value of the control:
const value = form.getItem("combo").getValue();
Methods
Check the full list of Combo methods.
Events
Check the full list of Combo events.
Working with the dhtmlxComboBox widget
You can use DHTMLX Combobox methods with the getWidget() method of a Combo control.
For example, to set focus in the Combo input without opening a popup with options, get the widget attached to the Combo control and call its focus() method.
const combo = form.getItem("combo").getWidget(); // -> ComboBox
combo.focus(); // sets focus in the input
Check the full list of DHTMLX Combobox methods that you can apply with the getWidget() method.