This mixin provides a common interface for the logical behavior and state of form fields, including:
If you do want to implement this mixin directly and don't want to extend Ext.form.BaseField, then you will most likely want to override the following methods with custom implementations: getValue, setValue, and getErrors. Other methods may be overridden as needed but their base implementations should be sufficient for common cases. You will also need to make sure that initField is called during the component's initialization.
Specifies whether this field should be validated immediately whenever a change in its value is detected. Defaults to true. If the validation results in a change in the field's validity, a validitychange event will be fired. This allows the field to show feedback about the validity of its contents immediately as the user is typing.
When set to false, feedback will not be immediate. However the form will still be validated before submitting if the clientValidation option to Ext.form.Basic-doAction is enabled, or if the field or form are validated manually.
See also Ext.form.BaseField-checkChangeEventsfor controlling how changes to the field's value are detected.
Checks whether the value of the field has changed since the last time it was checked. If the value has changed, it:
Runs this field's validators and returns an array of error messages for any validation failures. This is called internally during validation and would not usually need to be used manually.
Each subclass should override or augment the return value to provide their own errors.
Returns the parameter(s) that would be included in a standard form submit for this field. Typically this will be an object with a single name-value pair, the name being this field's name and the value being its current value. More advanced field implementations may return more than one name-value pair.
Note that the values returned from this method are not guaranteed to have been successfully validated.
Returns true if the value of this Field has been changed from its originalValue. Will always return false if the field is disabled.
Note that if the owning form was configured with trackResetOnLoad then the originalValue is updated when the values are loaded by Ext.form.Basic.setValues.
Returns whether or not the field value is currently valid by validating the field's current value. The validitychange event will not be fired; use validate instead if you want the event to fire. Note: disabled fields are always treated as valid.
Implementations are encouraged to ensure that this method does not have side-effects such as triggering error message display.
Returns whether or not the field value is currently valid by validating the field's current value, and fires the validitychange event if the field's validity has changed since the last validation. Note: disabled fields are always treated as valid.
Custom implementations of this method are allowed to have side-effects such as triggering error message display. To validate without side-effects, use isValid.