Extends
- argos._Field
Members
attributeMap
Properties:
Name | Type | Description |
---|---|---|
Creates |
Object | a setter map to html nodes, namely: * inputValue => inputNode's value attribute |
currentValue
Properties:
Name | Type | Description |
---|---|---|
Value |
Object/String/Date/Number | storage for current value, as it must be formatted for display this is the full value. |
originalValue
Properties:
Name | Type | Description |
---|---|---|
Value |
String | storage for keeping track of modified/unmodified values. Used in isDirty. |
required :Boolean
required should be true if the field requires input. Defaults to false.
Type:
- Boolean
validationValue
Properties:
Name | Type | Description |
---|---|---|
Value |
Object/String/Date/Number | storage for the value to use in validation, when gathering values from the editor view the validationValue is set using `getValues(true)` which returns all values even non-modified ones. |
view
widgetTemplate
Properties:
Name | Type | Description |
---|---|---|
Simplate |
Simplate | that defines the fields HTML Markup * `$` => Field instance * `$$` => Owner View instance |
Methods
_disableTextElement()
Sets the input nodes' disabled attribute to true
_enableTextElement()
Sets the input nodes' disabled attribute to false
_onClick(evt)
Handler for the `onclick` event of the fields container.
Invokes navigateToEditView.
Parameters:
Name | Type | Description |
---|---|---|
evt |
Event |
_onComplete()
Handler for `_onComplete` which is fired after the user has completed the form in the editor view
Fires onChange.
clearValue()
Clears the value by passing `null` to setValue
complete()
Handler for the toolbar item that is passed to the editor view. When this function fires
the view shown is the editor view but the function is fired in scope of the field.
It gets a handler of the current active view and validates the form, if it passes it gathers
the value, sets the fields text, calls `ReUI.back` and fires _onComplete.
createNavigationOptions()
Creates the navigation options to be passed to the editor view. The important part
of this code is that it passes `tools` that overrides the editors view toolbar with an item
that operates within this fields scope.
Returns:
Navigation options
disable()
Extends the parent implementation to also call _disableTextElement.
enable()
Extends the parent implementation to also call _enableTextElement.
formatValue(val)
Returns the formatted value. This should be overwritten to provide proper formatting
Parameters:
Name | Type | Description |
---|---|---|
val |
getValue() → {Object/String/Date/Number}
Returns the current value
Returns:
- Type
- Object/String/Date/Number
getValuesFromView()
Gets the values from the editor view and applies it to the this fields `this.currentValue` and
`this.validationValue`.
init()
Extends the parent implementation to connect the `onclick` event of the fields container
to _onClick.
isDirty() → {Boolean}
Determines if the value has been modified from the default/original state
Returns:
- Type
- Boolean
navigateToEditView()
Navigates to the given `this.view` using the options from createNavigationOptions.
setText(text)
Sets the displayed text to the input.
Parameters:
Name | Type | Description |
---|---|---|
text |
String |
setValue(val, initial)
Sets the current value to the item passed, as the default if initial is true. Then it sets
the displayed text using setText with the formatted value.
If null/false is passed all is cleared and `this.emptyText` is set as the displayed text.
Parameters:
Name | Type | Description |
---|---|---|
val |
Object/String/Date/Number | Value to be set |
initial |
Boolean | True if the value is the default/clean value, false if it is a meant as a dirty value |
validate(value)
Extends the parent implementation to use the `this.validationValue` instead of `this.getValue()`.
Parameters:
Name | Type | Description |
---|---|---|
value |