Type Definitions
menuItem
May be one of three possible types that specify either an <option>....</option>
element or an <optgroup>....</optgroup>
element as follows:
- If a
string
, specifies the text of an<option>....</option>
element with novalue
attribute. (In the absence of avalue
attribute, thevalue
property of the element defaults to the text.) - If shaped like a
valueItem
object, specifies both the text and value of an<option....</option>
element. - If shaped like a
submenuItem
object (or its alternate array form), specifies an<optgroup>....</optgroup>
element.
Type:
- string | valueItem | submenuItem
submenuItem
Hierarchical array of select list items.
Data structure representing the list of <option>...</option>
and <optgroup>...</optgroup>
elements that make up a <select>...</select>
element.
Alternate form: Instead of an object with a
menu
property containing an array, may itself be that array. Both forms have the optionallabel
property.
Type:
- object | Array.<menuItem>
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
label |
string |
<optional> |
Defaults to a generated string of the form "Group n[.m]..." where each decimal position represents a level of the optgroup hierarchy. |
submenu |
Array.<menuItem> |
valueItem
You should supply both name
and alias
(or header
) but you could omit one or the other and whichever you provide will be used for both.
If you only give the
name
property, you might as well just give a string formenuItem
rather than this object. Only thename
andalias
(orheader
) properties are standard. You can invent whatever other properties you need, such astype
andhidden
, shown here as suggestions.
Type:
- object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string |
<optional> |
alias || header | Value of |
alias |
string |
<optional> |
header | Text of |
header |
string |
<optional> |
name | Text of |
type |
string |
<optional> |
One of the keys of |
|
hidden |
boolean |
<optional> |
false |