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 novalueattribute. (In the absence of avalueattribute, thevalueproperty of the element defaults to the text.) - If shaped like a
valueItemobject, specifies both the text and value of an<option....</option>element. - If shaped like a
submenuItemobject (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
menuproperty containing an array, may itself be that array. Both forms have the optionallabelproperty.
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
nameproperty, you might as well just give a string formenuItemrather than this object. Only thenameandalias(orheader) properties are standard. You can invent whatever other properties you need, such astypeandhidden, 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 |