ludo.form.Number

ludo.form.


new ludo.form.Number(config)

A ludo.form.Text field accepting only numeric characters.

Parameters:
Name Type Description
config Object
Properties
Name Type Description
minValue Number

Optional minimum value

maxValue Number

Optional maximum value

disableWheel Boolean

Disable chaning values using mouse wheel.

reverseWheel Boolean

Reverse wheel. Up = smaller value.

shiftIncrement Number

Mouse wheel increment when shift key is pressed. Default = 10.

Source:

Extends

Methods


clear()

Reset value back to the original value sent(constructor value)

Inherited From:
Source:

commit()

Update initial value to current value. These actions will always trigger a commit

  • Form or Model submission
  • Fetching new record for a ludo.model.Model
Inherited From:
Source:

disable()

Disable form element

Inherited From:
Source:
Returns:

void


enable()

Enable form element

Inherited From:
Source:
Returns:

void


focus()

Focus form element

Inherited From:
Source:
Returns:

void


getFormEl()

Get reference to input element

Inherited From:
Source:
Returns:

DOMElement


isDirty() → {Boolean}

Returns true if current value is different from original value

Inherited From:
Source:
Returns:

isDirty

Type
Boolean

isValid() → {Boolean}

Returns true when value of form element is valid, i.e. larger than minValue, matching regex etc.

Inherited From:
Source:
Returns:

valid

Type
Boolean

reset()

Reset / Roll back to last committed value. It could be the value stored by last commit method call
or if the original value/default value of this field.

Inherited From:
Source:
Returns:

void


rollback()

Alias to reset

Inherited From:
Source:

setEnabled(enabled)

Enable or disable form element

Parameters:
Name Type Description
enabled Boolean
Inherited From:
Source:

setMaxValue(maxValue)

Update max value

Parameters:
Name Type Description
maxValue Number
Source:

setMinVal(minValue)

Update min value

Parameters:
Name Type Description
minValue Number
Source:

val(val) → {*}

Set or get value. If val argument is set, you will set a value, if not current value
will be returned.

Parameters:
Name Type Description
val String | Number | Array | Object | Boolean
Inherited From:
Source:
Returns:
Type
*