Class Index | File Index

Classes


Class JSComboBox


Extends JSComponent.

Defined in: toolkit.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
JSComboBox(preferences, selectElement, options)
A combo box component which allows any type of content (e.g.
Method Summary
Method Attributes Method Name and Description
 
 
setEnabled(enabled)
Enables or disables this combo box.
 
setSelectedItem(selectedItem)
 
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.
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.

© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Aug 21 2024 17:43:24 GMT+0200 (CEST)