Class: Select

components~Select(formElementId, choices, callback, initialSelected, selectAttributesopt, optionsopt)

An input control to make a choice among multiple options.

Constructor

new Select(formElementId, choices, callback, initialSelected, selectAttributesopt, optionsopt)

Parameters:
Name Type Attributes Default Description
formElementId string

The id of the form element.

choices Array

The array of possible choices to show.

callback function

The callback function for the change DOM event generated by the <select> element.

initialSelected number

The index of the option to appear as selected at initialization.

selectAttributes object <optional>
{}

The parameters to consider as attributes for the HTML <select> element.

Properties
Name Type Attributes Description
disabled boolean

Flag indicating whether the input field should be disabled at initialization.

multiple boolean <optional>

Flag indicating whether the <select> must show multiple choice rows. The selectAttributes.size overrides its behavior if present.

size number <optional>

The value that the <select> element would take as size attribute. The parameter will be ignored in case its value is bigger than the array length of the options parameter.

options object <optional>
{}

Parameters considered to generate the component.

Properties
Name Type Attributes Description
bootstrap string <optional>

If given, it indicates the Bootstrap version which the component should be built for.

Implements:
Source:

Members

domElement :HTMLDivElement

Reference to the DOM object that contains the HTML structure of the component.

Type:
  • HTMLDivElement
Inherited From:
Implements:
Source:

select :HTMLSelectElement

Reference to the DOM object representing the <select> element.

Type:
  • HTMLSelectElement
Source:

Methods

disable()

Disables the component.

Inherited From:
Implements:
Source:

enable()

Enables the component.

Inherited From:
Implements:
Source:

getId() → {any}

Returns the id of the input control element.

Implements:
Source:
Returns:

The value taken by the component.

Type
any

getValue() → {any}

Returns the value assigned to the component.

Implements:
Source:
Returns:

The value taken by the component.

Type
any