# new BaseField(props)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
props |
Object
|
Object of properties |
||
id |
String
|
Id of the field |
||
default |
*
|
<optional> |
null | Default value |
preview |
Boolean
|
<optional> |
true | If the value can be previewed |
onSave |
function
|
<optional> |
null | Callback for the save action. With one param as the new value. |
canSave |
Boolean
|
<optional> |
true | If the field can save ??? TODO: Better description |
Methods
# addListeners()
Listener for on change properties By default is change event for a Input[type=text] field
# buildDOM()
Builds the DOM representation of the widget By default is empty for a Input[type=text] field
# restore()
Restore the previous value & trigger onChange callback
# setDefault()
Set default value (Normally only in the constructor)
# setDOM()
Set the value to the DOM element By default apply like a Input[type=text]
# setElement()
Set the element to listen on changes Overload in some cases
# setValue(value)
Programmatically set the value of the widget and update the DOM to reflect the changes.
Parameters:
Name | Type | Description |
---|---|---|
value |
*
|