-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-form.field.Field'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-form-field-Field'>/**
</span> * @class Ext.form.field.Field
This mixin provides a common interface for the logical behavior and state of form fields, including:
*/
Ext.define('Ext.form.field.Field', {
-<span id='Ext-form.field.Field-property-isFormField'> /**
+<span id='Ext-form-field-Field-property-isFormField'> /**
</span> * @property isFormField
* @type {Boolean}
* Flag denoting that this component is a Field. Always true.
*/
isFormField : true,
-<span id='Ext-form.field.Field-cfg-value'> /**
+<span id='Ext-form-field-Field-cfg-value'> /**
</span> * @cfg {Mixed} value A value to initialize this field with (defaults to undefined).
*/
-<span id='Ext-form.field.Field-cfg-name'> /**
+<span id='Ext-form-field-Field-cfg-name'> /**
</span> * @cfg {String} name The name of the field (defaults to undefined). By default this is used as the parameter
* name when including the {@link #getSubmitData field value} in a {@link Ext.form.Basic#submit form submit()}.
* To prevent the field from being included in the form submit, set {@link #submitValue} to <tt>false</tt>.
*/
-<span id='Ext-form.field.Field-cfg-disabled'> /**
+<span id='Ext-form-field-Field-cfg-disabled'> /**
</span> * @cfg {Boolean} disabled True to disable the field (defaults to false). Disabled Fields will not be
* {@link Ext.form.Basic#submit submitted}.</p>
*/
disabled : false,
-<span id='Ext-form.field.Field-cfg-submitValue'> /**
+<span id='Ext-form-field-Field-cfg-submitValue'> /**
</span> * @cfg {Boolean} submitValue Setting this to <tt>false</tt> will prevent the field from being
* {@link Ext.form.Basic#submit submitted} even when it is not disabled. Defaults to <tt>true</tt>.
*/
submitValue: true,
-<span id='Ext-form.field.Field-cfg-validateOnChange'> /**
+<span id='Ext-form-field-Field-cfg-validateOnChange'> /**
</span> * @cfg {Boolean} validateOnChange
* <p>Specifies whether this field should be validated immediately whenever a change in its value is detected.
* Defaults to <tt>true</tt>. If the validation results in a change in the field's validity, a
*/
validateOnChange: true,
-<span id='Ext-form.field.Field-property-suspendCheckChange'> /**
+<span id='Ext-form-field-Field-property-suspendCheckChange'> /**
</span> * @private
*/
suspendCheckChange: 0,
-<span id='Ext-form.field.Field-method-initField'> /**
+<span id='Ext-form-field-Field-method-initField'> /**
</span> * Initializes this Field mixin on the current instance. Components using this mixin should call
* this method during their own initialization process.
*/
initField: function() {
this.addEvents(
-<span id='Ext-form.field.Field-event-change'> /**
+<span id='Ext-form-field-Field-event-change'> /**
</span> * @event change
* Fires when a user-initiated change is detected in the value of the field.
* @param {Ext.form.field.Field} this
* @param {Mixed} oldValue The original value
*/
'change',
-<span id='Ext-form.field.Field-event-validitychange'> /**
+<span id='Ext-form-field-Field-event-validitychange'> /**
</span> * @event validitychange
* Fires when a change in the field's validity is detected.
* @param {Ext.form.field.Field} this
* @param {Boolean} isValid Whether or not the field is now valid
*/
'validitychange',
-<span id='Ext-form.field.Field-event-dirtychange'> /**
+<span id='Ext-form-field-Field-event-dirtychange'> /**
</span> * @event dirtychange
* Fires when a change in the field's {@link #isDirty} state is detected.
* @param {Ext.form.field.Field} this
this.initValue();
},
-<span id='Ext-form.field.Field-method-initValue'> /**
+<span id='Ext-form-field-Field-method-initValue'> /**
</span> * @protected
* Initializes the field's value based on the initial config.
*/
initValue: function() {
var me = this;
-<span id='Ext-form.field.Field-property-originalValue'> /**
+<span id='Ext-form-field-Field-property-originalValue'> /**
</span> * @property originalValue
* @type Mixed
* The original value of the field as configured in the {@link #value} configuration, or as loaded by
me.suspendCheckChange--;
},
-<span id='Ext-form.field.Field-method-getName'> /**
+<span id='Ext-form-field-Field-method-getName'> /**
</span> * Returns the {@link Ext.form.field.Field#name name} attribute of the field. This is used as the parameter
* name when including the field value in a {@link Ext.form.Basic#submit form submit()}.
* @return {String} name The field {@link Ext.form.field.Field#name name}
return this.name;
},
-<span id='Ext-form.field.Field-method-getValue'> /**
+<span id='Ext-form-field-Field-method-getValue'> /**
</span> * 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 {@link Ext.form.field.Date}).
* @return {Mixed} value The field value
return this.value;
},
-<span id='Ext-form.field.Field-method-setValue'> /**
+<span id='Ext-form-field-Field-method-setValue'> /**
</span> * Sets a data value into the field and runs the change detection and validation.
* @param {Mixed} value The value to set
* @return {Ext.form.field.Field} this
return me;
},
-<span id='Ext-form.field.Field-method-isEqual'> /**
+<span id='Ext-form-field-Field-method-isEqual'> /**
</span> * Returns whether two field {@link #getValue values} are logically equal. Field implementations may override
* this to provide custom comparison logic appropriate for the particular field's data type.
* @param {Mixed} value1 The first value to compare
return String(value1) === String(value2);
},
-<span id='Ext-form.field.Field-method-getSubmitData'> /**
+<span id='Ext-form-field-Field-method-getSubmitData'> /**
</span> * <p>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 {@link #getName name} and the
* value being its current stringified value. More advanced field implementations may return more than one
return data;
},
-<span id='Ext-form.field.Field-method-getModelData'> /**
+<span id='Ext-form-field-Field-method-getModelData'> /**
</span> * <p>Returns the value(s) that should be saved to the {@link Ext.data.Model} instance for this field, when
* {@link Ext.form.Basic#updateRecord} is called. Typically this will be an object with a single name-value
* pair, the name being this field's {@link #getName name} and the value being its current data value. More
return data;
},
-<span id='Ext-form.field.Field-method-reset'> /**
+<span id='Ext-form-field-Field-method-reset'> /**
</span> * Resets the current field value to the originally loaded value and clears any validation messages.
* See {@link Ext.form.Basic}.{@link Ext.form.Basic#trackResetOnLoad trackResetOnLoad}
*/
delete me.wasValid;
},
-<span id='Ext-form.field.Field-method-resetOriginalValue'> /**
+<span id='Ext-form-field-Field-method-resetOriginalValue'> /**
</span> * Resets the field's {@link #originalValue} property so it matches the current {@link #getValue value}.
* This is called by {@link Ext.form.Basic}.{@link Ext.form.Basic#setValues setValues} if the form's
* {@link Ext.form.Basic#trackResetOnLoad trackResetOnLoad} property is set to true.
this.checkDirty();
},
-<span id='Ext-form.field.Field-method-checkChange'> /**
+<span id='Ext-form-field-Field-method-checkChange'> /**
</span> * <p>Checks whether the value of the field has changed since the last time it was checked. If the value
* has changed, it:</p>
* <ol>
}
},
-<span id='Ext-form.field.Field-method-onChange'> /**
+<span id='Ext-form-field-Field-method-onChange'> /**
</span> * @private
* Called when the field's value changes. Performs validation if the {@link #validateOnChange}
* config is enabled, and invokes the dirty check.
this.checkDirty();
},
-<span id='Ext-form.field.Field-method-isDirty'> /**
+<span id='Ext-form-field-Field-method-isDirty'> /**
</span> * <p>Returns true if the value of this Field has been changed from its {@link #originalValue}.
* Will always return false if the field is disabled.</p>
* <p>Note that if the owning {@link Ext.form.Basic form} was configured with
return !me.disabled && !me.isEqual(me.getValue(), me.originalValue);
},
-<span id='Ext-form.field.Field-method-checkDirty'> /**
+<span id='Ext-form-field-Field-method-checkDirty'> /**
</span> * Checks the {@link #isDirty} state of the field and if it has changed since the last time
* it was checked, fires the {@link #dirtychange} event.
*/
}
},
-<span id='Ext-form.field.Field-property-onDirtyChange'> /**
+<span id='Ext-form-field-Field-property-onDirtyChange'> /**
</span> * @private Called when the field's dirty state changes.
* @param {Boolean} isDirty
*/
onDirtyChange: Ext.emptyFn,
-<span id='Ext-form.field.Field-method-getErrors'> /**
+<span id='Ext-form-field-Field-method-getErrors'> /**
</span> * <p>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.</p>
* <p>Each subclass should override or augment the return value to provide their own errors.</p>
return [];
},
-<span id='Ext-form.field.Field-method-isValid'> /**
+<span id='Ext-form-field-Field-method-isValid'> /**
</span> * <p>Returns whether or not the field value is currently valid by {@link #getErrors validating} the
* field's current value. The {@link #validitychange} event will not be fired; use {@link #validate}
* instead if you want the event to fire. <b>Note</b>: {@link #disabled} fields are always treated as valid.</p>
return me.disabled || Ext.isEmpty(me.getErrors());
},
-<span id='Ext-form.field.Field-method-validate'> /**
+<span id='Ext-form-field-Field-method-validate'> /**
</span> * <p>Returns whether or not the field value is currently valid by {@link #getErrors validating} the
* field's current value, and fires the {@link #validitychange} event if the field's validity has
* changed since the last validation. <b>Note</b>: {@link #disabled} fields are always treated as valid.</p>
return isValid;
},
-<span id='Ext-form.field.Field-method-batchChanges'> /**
+<span id='Ext-form-field-Field-method-batchChanges'> /**
</span> * A utility for grouping a set of modifications which may trigger value changes into a single
* transaction, to prevent excessive firing of {@link #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
this.checkChange();
},
-<span id='Ext-form.field.Field-method-isFileUpload'> /**
+<span id='Ext-form-field-Field-method-isFileUpload'> /**
</span> * Returns whether this Field is a file upload field; if it returns true, forms will use
* special techniques for {@link Ext.form.Basic#submit submitting the form} via AJAX. See
* {@link Ext.form.Basic#hasUpload} for details. If this returns true, the {@link #extractFileInput}
return false;
},
-<span id='Ext-form.field.Field-method-extractFileInput'> /**
+<span id='Ext-form-field-Field-method-extractFileInput'> /**
</span> * Only relevant if the instance's {@link #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.
return null;
},
-<span id='Ext-form.field.Field-property-markInvalid'> /**
+<span id='Ext-form-field-Field-method-markInvalid'> /**
</span> * <p>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.</p>
* <p><b>Note</b>: this method does not cause the Field's {@link #validate} or {@link #isValid} methods to
* will not prevent submission of forms submitted with the {@link Ext.form.action.Submit#clientValidation}
* option set.</p>
* @param {String/Array} errors The error message(s) for the field.
+ * @method
*/
markInvalid: Ext.emptyFn,
-<span id='Ext-form.field.Field-property-clearInvalid'> /**
+<span id='Ext-form-field-Field-method-clearInvalid'> /**
</span> * <p>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.</p>
* <p><b>Note</b>: this method does not cause the Field's {@link #validate} or {@link #isValid} methods to
* return <code>true</code> if the value does not <i>pass</i> validation. So simply clearing a field's errors
* will not necessarily allow submission of forms submitted with the {@link Ext.form.action.Submit#clientValidation}
* option set.</p>
+ * @method
*/
clearInvalid: Ext.emptyFn
});
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>