X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/source/Field.html diff --git a/docs/source/Field.html b/docs/source/Field.html index 394599e4..1198ebbc 100644 --- a/docs/source/Field.html +++ b/docs/source/Field.html @@ -1,4 +1,21 @@ -
/**
+
+
+
+
+ The source code
+
+
+
+
+
+
+ /**
* @class Ext.form.field.Field
This mixin provides a common interface for the logical behavior and state of form fields, including:
@@ -23,36 +40,36 @@ is called during the component's initialization.
*/
Ext.define('Ext.form.field.Field', {
- /**
+ /**
* @property isFormField
* @type {Boolean}
* Flag denoting that this component is a Field. Always true.
*/
isFormField : true,
- /**
+ /**
* @cfg {Mixed} value A value to initialize this field with (defaults to undefined).
*/
- /**
+ /**
* @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>.
*/
- /**
+ /**
* @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,
- /**
+ /**
* @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,
- /**
+ /**
* @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
@@ -65,18 +82,18 @@ Ext.define('Ext.form.field.Field', {
*/
validateOnChange: true,
- /**
+ /**
* @private
*/
suspendCheckChange: 0,
- /**
+ /**
* 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(
- /**
+ /**
* @event change
* Fires when a user-initiated change is detected in the value of the field.
* @param {Ext.form.field.Field} this
@@ -84,14 +101,14 @@ Ext.define('Ext.form.field.Field', {
* @param {Mixed} oldValue The original value
*/
'change',
- /**
+ /**
* @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',
- /**
+ /**
* @event dirtychange
* Fires when a change in the field's {@link #isDirty} state is detected.
* @param {Ext.form.field.Field} this
@@ -103,14 +120,14 @@ Ext.define('Ext.form.field.Field', {
this.initValue();
},
- /**
+ /**
* @protected
* Initializes the field's value based on the initial config.
*/
initValue: function() {
var me = this;
- /**
+ /**
* @property originalValue
* @type Mixed
* The original value of the field as configured in the {@link #value} configuration, or as loaded by
@@ -125,7 +142,7 @@ Ext.define('Ext.form.field.Field', {
me.suspendCheckChange--;
},
- /**
+ /**
* 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}
@@ -134,7 +151,7 @@ Ext.define('Ext.form.field.Field', {
return this.name;
},
- /**
+ /**
* 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
@@ -143,7 +160,7 @@ Ext.define('Ext.form.field.Field', {
return this.value;
},
- /**
+ /**
* 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
@@ -155,7 +172,7 @@ Ext.define('Ext.form.field.Field', {
return me;
},
- /**
+ /**
* 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
@@ -166,7 +183,7 @@ Ext.define('Ext.form.field.Field', {
return String(value1) === String(value2);
},
- /**
+ /**
* <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
@@ -187,7 +204,7 @@ Ext.define('Ext.form.field.Field', {
return data;
},
- /**
+ /**
* <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
@@ -209,7 +226,7 @@ Ext.define('Ext.form.field.Field', {
return data;
},
- /**
+ /**
* 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}
*/
@@ -222,7 +239,7 @@ Ext.define('Ext.form.field.Field', {
delete me.wasValid;
},
- /**
+ /**
* 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.
@@ -232,7 +249,7 @@ Ext.define('Ext.form.field.Field', {
this.checkDirty();
},
- /**
+ /**
* <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>
@@ -256,7 +273,7 @@ Ext.define('Ext.form.field.Field', {
}
},
- /**
+ /**
* @private
* Called when the field's value changes. Performs validation if the {@link #validateOnChange}
* config is enabled, and invokes the dirty check.
@@ -268,7 +285,7 @@ Ext.define('Ext.form.field.Field', {
this.checkDirty();
},
- /**
+ /**
* <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
@@ -283,7 +300,7 @@ Ext.define('Ext.form.field.Field', {
return !me.disabled && !me.isEqual(me.getValue(), me.originalValue);
},
- /**
+ /**
* 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.
*/
@@ -297,13 +314,13 @@ Ext.define('Ext.form.field.Field', {
}
},
- /**
+ /**
* @private Called when the field's dirty state changes.
* @param {Boolean} isDirty
*/
onDirtyChange: Ext.emptyFn,
- /**
+ /**
* <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>
@@ -314,7 +331,7 @@ Ext.define('Ext.form.field.Field', {
return [];
},
- /**
+ /**
* <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>
@@ -327,7 +344,7 @@ Ext.define('Ext.form.field.Field', {
return me.disabled || Ext.isEmpty(me.getErrors());
},
- /**
+ /**
* <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>
@@ -345,7 +362,7 @@ Ext.define('Ext.form.field.Field', {
return isValid;
},
- /**
+ /**
* 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
@@ -359,7 +376,7 @@ Ext.define('Ext.form.field.Field', {
this.checkChange();
},
- /**
+ /**
* 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}
@@ -370,7 +387,7 @@ Ext.define('Ext.form.field.Field', {
return false;
},
- /**
+ /**
* 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.
@@ -380,7 +397,7 @@ Ext.define('Ext.form.field.Field', {
return null;
},
- /**
+ /**
* <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
@@ -388,18 +405,22 @@ Ext.define('Ext.form.field.Field', {
* 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,
- /**
+ /**
* <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
});
-
\ No newline at end of file
+
+
+