Dropdown
Dropdowns present selectable lists with optional search, multi-select, and formatter support.
Playground
A dropdown
Control dropdown height
Allow selecting multiple values
Permit clearing the selection
Enable searching through values
Usage
You can create a Dropdown by calling the AddDropdown
method on a Groupbox.
Arguments
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Index/ID of the dropdown | string | nil |
2 | Dropdown configuration table | table | nil |
Configuration Table
Prop
Type
Methods
You can use the following methods to interact with the dropdown:
SetValue
Sets the selected value or values.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Value to select (string, number, or table) | any | nil |
SetValues
Replaces all dropdown values.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | New values list | table | nil |
AddValues
Adds new values to the dropdown.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Value or table of values to add | any | nil |
SetDisabledValues
Sets which values are disabled.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Table of values to disable | table | nil |
AddDisabledValues
Adds values to the disabled list.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Value or table of values to disable | any | nil |
SetText
Updates the dropdown's label text.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | New label text | string | nil |
SetDisabled
Enables or disables the dropdown.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Whether to disable the dropdown | boolean | nil |
SetVisible
Shows or hides the dropdown.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Whether to show the dropdown | boolean | nil |
OnChanged
Adds another callback function.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Callback executed when the dropdown changes | function | nil |