new Spinbox(parent, optionsopt) → {Spinbox}
Create a new spinbox widget.
Parameters
-
parent
object
Parent element.
-
options
object
<optional>
Options.
Properties
-
title
string
<optional>
'Enter value'Title of the control.
-
dmin
number
<optional>
Minimum value.
-
dmax
number
<optional>
Maximum value.
-
step
number
<optional>
Initial value increment between autorepeat updates.
-
initValue
number
<optional>
Initial value.
-
repButton
boolean
<optional>
trueUp/Down spin buttons have autorepeat?
-
instantUpdate
boolean
<optional>
falseReturn updated value at each autorepeat update?
-
className
string
<optional>
Element class name for the widget.
-
title
Returns
-
Spinbox
Spinbox widget element.
Source
Methods
_offset(target, direction)
Increment or decrement spinbox value.
Parameters
-
target
object
Element that triggered the action.
-
direction
number
Step direction (-1 or +1).
Source
_prec(step) → {number}
Set spinbox value precision.
Parameters
-
step
number
Increment value.
Returns
-
number
Number of decimals.
Source
_sboxRun()
Run one step of the spinbox.
Source
disable()
Disable the spinbox widget.
Source
enable()
Enable the spinbox widget.
Source
step(valopt) → {number}
Return or set the current increment value of the spinbox.
Parameters
-
val
number
<optional>
If provided, set the spinbox increment value to that of
val
.
Returns
-
number
Spinbox increment value.
Source
value(valopt) → {number}
Return or set the current value of the spinbox.
Parameters
-
val
number
<optional>
If provided, set the spinbox value to that of
val
.
Returns
-
number
Spinbox value.