new ludo.form.Element(config)
Super class for form Views.
This class inherits from ludo.View.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Configuration when creating the View. These properties and properties from superclass is available Properties
|
- Source:
Fires:
- ludo.form.Element#enable - Fired on enable, argument: ludo.form.event:Element
- ludo.form.Element#disable - Fired on disable, argument: ludo.form.event:Element
- ludo.form.Element#key_down - Fired on key down. Arguments: key, value, ludo.form.event:Element
- ludo.form.Element#key_up - Fired on key up. Arguments: key, value, ludo.form.event:Element
- ludo.form.Element#key_press - Fired on key up. Arguments: key, value, ludo.form.event:Element
- ludo.form.Element#focus - Fired on focus received. Arguments: value, ludo.form.event:Element
- ludo.form.Element#blur - Fired on blur. Arguments: value, ludo.form.event:Element
- ludo.form.Element#change - Fired on changed value by GUI. Arguments: value, ludo.form.event:Element
- ludo.form.Element#valueChange - Fired on changed value by GUI or the val function. Arguments: value, ludo.form.event:Element
- ludo.form.Element#dirty - Fired on new value which is different from initial. Arguments. value, ludo.form.event:Element
- ludo.form.Element#clean - Fired on new value which is the same as initial. Arguments. value, ludo.form.event:Element
- ludo.form.Element#value - Fired when a new valid value is set. Arguments. value, ludo.form.event:Element
- ludo.form.Element#invalid - Fired when a new value is set which is invalid. Arguments. value, ludo.form.event:Element
Methods
-
clear()
-
Reset value back to the original value sent(constructor value)
- 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
- Source:
-
disable()
-
Disable form element
- Source:
Returns:
void
-
enable()
-
Enable form element
- Source:
Returns:
void
-
getFormEl()
-
Get reference to input element
- Source:
Returns:
DOMElement
-
isDirty() → {Boolean}
-
Returns true if current value is different from original value
- Source:
Returns:
isDirty
- Type
- Boolean
-
isValid() → {Boolean}
-
Returns true when value of form element is valid, i.e. larger than minValue, matching regex etc.
- 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.- Source:
Returns:
void
-
rollback()
-
Alias to reset
- Source:
-
setEnabled(enabled)
-
Enable or disable form element
Parameters:
Name Type Description enabled
Boolean - 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 - Source:
Returns:
- Type
- *