Class type Ext_form_field_Field.t


class type t = object .. end
Inherits
method isFormField : bool Js.t Js.prop

Flag denoting that this component is a Field. Always true.

Defaults to: true

method originalValue : 'a. 'a Js.t Js.prop

The original value of the field as configured in the value configuration, or as loaded by the last form load operation if the form's trackResetOnLoad setting is true.


method batchChanges : 'b. 'b Js.t -> unit Js.meth

A utility for grouping a set of modifications which may trigger value changes into a single transaction, to prevent excessive firing of change events. This is useful for instance if the field has sub-fields which are being updated as a group; you don't want the container field to check its own changed state for each subfield change.

Parameters:


method beforeReset : unit Js.meth

Template method before a field is reset.


method checkChange : unit Js.meth

Checks whether the value of the field has changed since the last time it was checked. If the value has changed, it:

  1. Fires the change event,
  2. Performs validation if the validateOnChange config is enabled, firing the validitychange event if the validity has changed, and
  3. Checks the dirty state of the field and fires the dirtychange event if it has changed.

method checkDirty : unit Js.meth

Checks the isDirty state of the field and if it has changed since the last time it was checked, fires the dirtychange event.


method clearInvalid : unit Js.meth

Clear any invalid styles/messages for this field. Components using this mixin should implement this method to update the components rendering to clear any existing messages.

Note: this method does not cause the Field's validate or isValid methods to return true if the value does not pass validation. So simply clearing a field's errors will not necessarily allow submission of forms submitted with the Ext.form.action.Submit.clientValidation option set.


method extractFileInput : Dom_html.element Js.t Js.meth

Only relevant if the instance's isFileUpload method returns true. Returns a reference to the file input DOM element holding the user's selected file. The input will be appended into the submission form and will not be returned, so this method should also create a replacement.


method getErrors : 'c. 'c Js.t -> Js.js_string Js.t Js.js_array Js.t Js.meth

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.

Parameters:

Returns:


method getModelData : 'd. 'd Js.t Js.meth

Returns the value(s) that should be saved to the Ext.data.Model instance for this field, when Ext.form.Basic.updateRecord is called. 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 data value. More advanced field implementations may return more than one name-value pair. The returned values will be saved to the corresponding field names in the Model.

Note that the values returned from this method are not guaranteed to have been successfully validated.

Returns:


method getName : Js.js_string Js.t Js.meth

Returns the name attribute of the field. This is used as the parameter name when including the field value in a form submit().

Returns:


method getSubmitData : 'e. 'e Js.t Js.meth

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 stringified 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:


method getValue : 'f. 'f Js.t Js.meth

Returns the current data value of the field. The type of value returned is particular to the type of the particular field (e.g. a Date object for Ext.form.field.Date).

Returns:


method initField : unit Js.meth

Initializes this Field mixin on the current instance. Components using this mixin should call this method during their own initialization process.


method initValue : unit Js.meth

Initializes the field's value based on the initial config.


method isDirty : bool Js.t Js.meth

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:


method isEqual : 'g 'h. 'g Js.t -> 'h Js.t -> bool Js.t Js.meth

Returns whether two field values are logically equal. Field implementations may override this to provide custom comparison logic appropriate for the particular field's data type.

Parameters:

Returns:


method isFileUpload : bool Js.t Js.meth

Returns whether this Field is a file upload field; if it returns true, forms will use special techniques for submitting the form via AJAX. See Ext.form.Basic.hasUpload for details. If this returns true, the extractFileInput method must also be implemented to return the corresponding file input element.


method isValid : bool Js.t Js.meth

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:


method markInvalid : 'i. 'i Js.t -> unit Js.meth

Associate one or more error messages with this field. Components using this mixin should implement this method to update the component's rendering to display the messages.

Note: this method does not cause the Field's validate or isValid methods to return false if the value does pass validation. So simply marking a Field as invalid will not prevent submission of forms submitted with the Ext.form.action.Submit.clientValidation option set.

Parameters:


method reset : unit Js.meth

Resets the current field value to the originally loaded value and clears any validation messages. See Ext.form.Basic.trackResetOnLoad


method resetOriginalValue : unit Js.meth

Resets the field's originalValue property so it matches the current value. This is called by Ext.form.Basic.setValues if the form's trackResetOnLoad property is set to true.


method setValue : 'j.
'j Js.t ->
(< batchChanges : 'b. 'b Js.t -> unit Js.meth; beforeReset : unit Js.meth;
callParent : 'm 'n. 'm Js.t -> 'n Js.t Js.meth;
callSuper : 'o 'p. 'o Js.t -> 'p Js.t Js.meth;
checkChange : unit Js.meth; checkDirty : unit Js.meth;
clearInvalid : unit Js.meth;
extractFileInput : Dom_html.element Js.t Js.meth;
getErrors : 'c. 'c Js.t -> Js.js_string Js.t Js.js_array Js.t Js.meth;
getInitialConfig : 'q. Js.js_string Js.t Js.optdef -> 'q Js.t Js.meth;
getModelData : 'd. 'd Js.t Js.meth; getName : Js.js_string Js.t Js.meth;
getSubmitData : 'e. 'e Js.t Js.meth; getValue : 'f. 'f Js.t Js.meth;
initConfig : 'r. 'r Js.t -> 'l Js.t Js.meth; initField : unit Js.meth;
initValue : unit Js.meth; isDirty : bool Js.t Js.meth;
isEqual : 'g 'h. 'g Js.t -> 'h Js.t -> bool Js.t Js.meth;
isFileUpload : bool Js.t Js.meth; isFormField : bool Js.t Js.prop;
isValid : bool Js.t Js.meth; markInvalid : 'i. 'i Js.t -> unit Js.meth;
originalValue : 'a. 'a Js.t Js.prop; reset : unit Js.meth;
resetOriginalValue : unit Js.meth; self : Ext_Class.t Js.t Js.prop;
setValue : 'j. 'k; statics : Ext_Class.t Js.t Js.meth;
transformOriginalValue : 's 't. 's Js.t -> 't Js.t Js.meth;
validate : bool Js.t Js.meth; .. >
as 'l)
Js.t Js.meth as 'k

Sets a data value into the field and runs the change detection and validation.

Parameters:

Returns:


method transformOriginalValue : 's 't. 's Js.t -> 't Js.t Js.meth

Allows for any necessary modifications before the original value is set

Parameters:

Returns:


method validate : bool Js.t Js.meth

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.

Returns: