Skip to main content

SelectButton

The SelectButton control displays a button with a drop-down list of options.

Toolbar select button with an expanded dropdown of options and hotkeys in DHTMLX Suite

Related sample: Toolbar. SelectButton

Add SelectButton​

Use the add() method of TreeCollection to add a SelectButton control to a toolbar:

toolbar.data.add(
{
id: "title",
value: "Select count or use alt+num"
},
{
id: "currentButton",
type: "selectButton",
value: "1",
items: [
{
value: "1",
hotkey: "alt+1"
},
{
value: "2",
hotkey: "alt+2"
},
{
value: "3",
hotkey: "alt+3"
},
{
value: "4",
hotkey: "alt+4"
}
]
}
);

Properties​

Check the list of properties that you can set in the configuration object of a SelectButton control.

Work with SelectButton​

Use the Toolbar API and the TreeCollection API to work with a SelectButton control.