Select
Last updated
Last updated
Select field renders a native select element. Supports optgroups
and disabled
attributes.
This will produce the following
It will use the option text as the value. If you wish to separate values from option texts use the following syntax for the choices
key:
disabled
If disabled
keys are specified, they'll be respected. E.g:
will result in the following
Notice that the third option is not selectable.
optgroups
You can create complex select elements with optgroups
. To do that, use the optgroups
key instead of choices
. Each optgroup
has the following signature:
where label
will store the text for the label
attribute and choices
is an array of options like in the example configuration.
The following configuration
will result in the following
Note that the whole second optgroup
is disabled because the disabled
key is specified for the optgoup
itself, not like individual disabled
keys in groups 1 and 3.
Name
Type
Description
type
string
select
(required)
id
string
Unique ID that will be used to retrieve the value (required)
tab
string
Specifies in which tab this option will be rendered
title
string
Shows a heading to the left of the field
desc
string
Shows a description text (can have HTML)
choices
array
optgroups
array
Can be an array of strings or an array of arrays with value
and label
keys. See above.
Array of arrays with label
and choices
keys. See above.