Class JSComboBox
Extends
JSComponent.
Defined in: toolkit.js.
Constructor Attributes | Constructor Name and Description |
---|---|
JSComboBox(preferences, selectElement, options)
A combo box component which allows any type of content (e.g.
|
Method Attributes | Method Name and Description |
---|---|
setEnabled(enabled)
Enables or disables this combo box.
|
|
setSelectedItem(selectedItem)
|
|
updateUI()
Refreshes UI, i.e.
|
- Methods borrowed from class JSComponent:
- attachChildComponent, buildHtmlFromTemplate, dispose, findElement, findElements, getElement, getHTMLElement, getLocalizedLabelText, getUserPreferences, registerEventListener, registerPropertyChangeListener
Class Detail
JSComboBox(preferences, selectElement, options)
A combo box component which allows any type of content (e.g. images).
Author: Louis Grignon.
Author: Louis Grignon.
- Parameters:
- {UserPreferences} preferences
- the current user preferences
- {HTMLElement} selectElement
- HTML element on which install this component
- {{nullable?: boolean|value?: any|availableValues: (any)[]|renderCell?: function(value: any|element: HTMLElement)|selectionChanged: function(newValue: any)}} options Optional
- - nullable: false if null/undefined is not allowed - default false - value: initial value - default undefined if nullable or first available value, - availableValues: available values in this combo, - renderCell: a function which builds displayed element for a given value - defaults to setting textContent to value.toString() - selectionChanged: called with new value when selected by user
Method Detail
{number}
getSelectedItem()
- Returns:
- {number} the value selected in this combo box
setEnabled(enabled)
Enables or disables this combo box.
- Parameters:
- {boolean} enabled
setSelectedItem(selectedItem)
- Parameters:
- {number} selectedItem
- the value to select in this combo box
updateUI()
Refreshes UI, i.e. preview of selected value.