Constructor
new SpinnerControl(config, format, onChange)
Create spinner control.
The structure generated by the code is effectively
- div: className hcje-spinner-control
- span hcje-control-label
- div className hcje-spinner-control__inner
- input classNames hcje-button hcje-spinner-control__inner__down-button
- div className hcje-spinner-control__inner__value
- input classNames hcje-button hcje-spinner-control__inner__up-button
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
format |
module:hcje/domTools.SpinnerControl~format | Formatting function. This takes the value and returns formated value. This is called before onChange. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
onChange |
module:hcje/domTools.SpinnerControl~onChangeCallback | called with new value after changes. Note it is provided with the spinner's numerical value, not its formatted value. |
- Source:
Extends
- module:hcje/domTools.BaseControl
Methods
getValue() → {number}
Get the current value.
- Source:
Returns:
- Type
- number
Type Definitions
format(value) → {string}
Formatting function for a SpinnerControl.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Current value. This is the numerical value, no the formatted value. |
- Source:
Returns:
Formatted version of the numerical value.
- Type
- string
onChangeCallback(value)
Callback function for a SpinnerControl.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Current value. This is the numerical value, not the formatted value. |
- Source: