Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / Field.html
index 394599e..1198ebb 100644 (file)
@@ -1,4 +1,21 @@
-<!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:
@@ -23,36 +40,36 @@ is called during the component's initialization.
  */
 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 &lt;tt&gt;false&lt;/tt&gt;.
      */
 
-<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}.&lt;/p&gt;
      */
     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 &lt;tt&gt;false&lt;/tt&gt; will prevent the field from being
      * {@link Ext.form.Basic#submit submitted} even when it is not disabled. Defaults to &lt;tt&gt;true&lt;/tt&gt;.
      */
     submitValue: true,
 
-<span id='Ext-form.field.Field-cfg-validateOnChange'>    /**
+<span id='Ext-form-field-Field-cfg-validateOnChange'>    /**
 </span>     * @cfg {Boolean} validateOnChange
      * &lt;p&gt;Specifies whether this field should be validated immediately whenever a change in its value is detected.
      * Defaults to &lt;tt&gt;true&lt;/tt&gt;. 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,
 
-<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
@@ -84,14 +101,14 @@ Ext.define('Ext.form.field.Field', {
              * @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
@@ -103,14 +120,14 @@ Ext.define('Ext.form.field.Field', {
         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
@@ -125,7 +142,7 @@ Ext.define('Ext.form.field.Field', {
         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}
@@ -134,7 +151,7 @@ Ext.define('Ext.form.field.Field', {
         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
@@ -143,7 +160,7 @@ Ext.define('Ext.form.field.Field', {
         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
@@ -155,7 +172,7 @@ Ext.define('Ext.form.field.Field', {
         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
@@ -166,7 +183,7 @@ Ext.define('Ext.form.field.Field', {
         return String(value1) === String(value2);
     },
 
-<span id='Ext-form.field.Field-method-getSubmitData'>    /**
+<span id='Ext-form-field-Field-method-getSubmitData'>    /**
 </span>     * &lt;p&gt;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;
     },
 
-<span id='Ext-form.field.Field-method-getModelData'>    /**
+<span id='Ext-form-field-Field-method-getModelData'>    /**
 </span>     * &lt;p&gt;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;
     },
 
-<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}
      */
@@ -222,7 +239,7 @@ Ext.define('Ext.form.field.Field', {
         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.
@@ -232,7 +249,7 @@ Ext.define('Ext.form.field.Field', {
         this.checkDirty();
     },
 
-<span id='Ext-form.field.Field-method-checkChange'>    /**
+<span id='Ext-form-field-Field-method-checkChange'>    /**
 </span>     * &lt;p&gt;Checks whether the value of the field has changed since the last time it was checked. If the value
      * has changed, it:&lt;/p&gt;
      * &lt;ol&gt;
@@ -256,7 +273,7 @@ Ext.define('Ext.form.field.Field', {
         }
     },
 
-<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.
@@ -268,7 +285,7 @@ Ext.define('Ext.form.field.Field', {
         this.checkDirty();
     },
 
-<span id='Ext-form.field.Field-method-isDirty'>    /**
+<span id='Ext-form-field-Field-method-isDirty'>    /**
 </span>     * &lt;p&gt;Returns true if the value of this Field has been changed from its {@link #originalValue}.
      * Will always return false if the field is disabled.&lt;/p&gt;
      * &lt;p&gt;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 &amp;&amp; !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.
      */
@@ -297,13 +314,13 @@ Ext.define('Ext.form.field.Field', {
         }
     },
 
-<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>     * &lt;p&gt;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.&lt;/p&gt;
      * &lt;p&gt;Each subclass should override or augment the return value to provide their own errors.&lt;/p&gt;
@@ -314,7 +331,7 @@ Ext.define('Ext.form.field.Field', {
         return [];
     },
 
-<span id='Ext-form.field.Field-method-isValid'>    /**
+<span id='Ext-form-field-Field-method-isValid'>    /**
 </span>     * &lt;p&gt;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. &lt;b&gt;Note&lt;/b&gt;: {@link #disabled} fields are always treated as valid.&lt;/p&gt;
@@ -327,7 +344,7 @@ Ext.define('Ext.form.field.Field', {
         return me.disabled || Ext.isEmpty(me.getErrors());
     },
 
-<span id='Ext-form.field.Field-method-validate'>    /**
+<span id='Ext-form-field-Field-method-validate'>    /**
 </span>     * &lt;p&gt;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. &lt;b&gt;Note&lt;/b&gt;: {@link #disabled} fields are always treated as valid.&lt;/p&gt;
@@ -345,7 +362,7 @@ Ext.define('Ext.form.field.Field', {
         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
@@ -359,7 +376,7 @@ Ext.define('Ext.form.field.Field', {
         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}
@@ -370,7 +387,7 @@ Ext.define('Ext.form.field.Field', {
         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.
@@ -380,7 +397,7 @@ Ext.define('Ext.form.field.Field', {
         return null;
     },
 
-<span id='Ext-form.field.Field-property-markInvalid'>    /**
+<span id='Ext-form-field-Field-method-markInvalid'>    /**
 </span>     * &lt;p&gt;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.&lt;/p&gt;
      * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: 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.&lt;/p&gt;
      * @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>     * &lt;p&gt;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.&lt;/p&gt;
      * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this method does not cause the Field's {@link #validate} or {@link #isValid} methods to
      * return &lt;code&gt;true&lt;/code&gt; if the value does not &lt;i&gt;pass&lt;/i&gt; 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.&lt;/p&gt;
+     * @method
      */
     clearInvalid: Ext.emptyFn
 
 });
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>