X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/source/Checkbox.html diff --git a/docs/source/Checkbox.html b/docs/source/Checkbox.html index fcf8e747..6d11c417 100644 --- a/docs/source/Checkbox.html +++ b/docs/source/Checkbox.html @@ -1,4 +1,21 @@ -Sencha Documentation Project
/**
+
+
+
+  
+  The source code
+  
+  
+  
+  
+
+
+  
/**
  * @class Ext.form.field.Checkbox
  * @extends Ext.form.field.Base
 
@@ -71,7 +88,7 @@ __Example usage:__
                     var checkbox1 = Ext.getCmp('checkbox1'),
                         checkbox2 = Ext.getCmp('checkbox2'),
                         checkbox3 = Ext.getCmp('checkbox3');
-    
+
                     checkbox1.setValue(true);
                     checkbox2.setValue(true);
                     checkbox3.setValue(true);
@@ -83,7 +100,7 @@ __Example usage:__
                     var checkbox1 = Ext.getCmp('checkbox1'),
                         checkbox2 = Ext.getCmp('checkbox2'),
                         checkbox3 = Ext.getCmp('checkbox3');
-    
+
                     checkbox1.setValue(false);
                     checkbox2.setValue(false);
                     checkbox3.setValue(false);
@@ -127,62 +144,62 @@ Ext.define('Ext.form.field.Checkbox', {
 
     isCheckbox: true,
 
-    /**
+    /**
      * @cfg {String} focusCls The CSS class to use when the checkbox receives focus
      * (defaults to <tt>'x-form-cb-focus'</tt>)
      */
     focusCls: Ext.baseCSSPrefix + 'form-cb-focus',
 
-    /**
+    /**
      * @cfg {String} fieldCls The default CSS class for the checkbox (defaults to <tt>'x-form-field'</tt>)
      */
 
-    /**
+    /**
      * @cfg {String} fieldBodyCls
      * An extra CSS class to be applied to the body content element in addition to {@link #fieldBodyCls}.
      * Defaults to 'x-form-cb-wrap.
      */
     fieldBodyCls: Ext.baseCSSPrefix + 'form-cb-wrap',
 
-    /**
+    /**
      * @cfg {Boolean} checked <tt>true</tt> if the checkbox should render initially checked (defaults to <tt>false</tt>)
      */
     checked: false,
 
-    /**
+    /**
      * @cfg {String} checkedCls The CSS class added to the component's main element when it is in the checked state.
      */
     checkedCls: Ext.baseCSSPrefix + 'form-cb-checked',
 
-    /**
+    /**
      * @cfg {String} boxLabel An optional text label that will appear next to the checkbox. Whether it appears before
      * or after the checkbox is determined by the {@link #boxLabelAlign} config (defaults to after).
      */
 
-    /**
+    /**
      * @cfg {String} boxLabelCls The CSS class to be applied to the {@link #boxLabel} element
      */
     boxLabelCls: Ext.baseCSSPrefix + 'form-cb-label',
 
-    /**
+    /**
      * @cfg {String} boxLabelAlign The position relative to the checkbox where the {@link #boxLabel} should
      * appear. Recognized values are <tt>'before'</tt> and <tt>'after'</tt>. Defaults to <tt>'after'</tt>.
      */
     boxLabelAlign: 'after',
 
-    /**
+    /**
      * @cfg {String} inputValue The value that should go into the generated input element's value attribute and
      * should be used as the parameter value when submitting as part of a form. Defaults to <tt>"on"</tt>.
      */
     inputValue: 'on',
 
-    /**
+    /**
      * @cfg {String} uncheckedValue If configured, this will be submitted as the checkbox's value during form
      * submit if the checkbox is unchecked. By default this is undefined, which results in nothing being
      * submitted for the checkbox field when the form is submitted (the default behavior of HTML checkboxes).
      */
 
-    /**
+    /**
      * @cfg {Function} handler A function called when the {@link #checked} value changes (can be used instead of
      * handling the {@link #change change event}). The handler is passed the following parameters:
      * <div class="mdetail-params"><ul>
@@ -191,7 +208,7 @@ Ext.define('Ext.form.field.Checkbox', {
      * </ul></div>
      */
 
-    /**
+    /**
      * @cfg {Object} scope An object to use as the scope ('this' reference) of the {@link #handler} function
      * (defaults to this Checkbox).
      */
@@ -213,7 +230,7 @@ Ext.define('Ext.form.field.Checkbox', {
         var me = this,
             checked = !!me.checked;
 
-        /**
+        /**
          * The original value of the field as configured in the {@link #checked} configuration, or
          * as loaded by the last form load operation if the form's {@link Ext.form.Basic#trackResetOnLoad trackResetOnLoad}
          * setting is <code>true</code>.
@@ -230,7 +247,7 @@ Ext.define('Ext.form.field.Checkbox', {
     onRender : function(ct, position) {
         var me = this;
         Ext.applyIf(me.renderSelectors, {
-            /**
+            /**
              * @property boxLabelEl
              * @type Ext.core.Element
              * A reference to the label element created for the {@link #boxLabel}. Only present if the
@@ -253,7 +270,7 @@ Ext.define('Ext.form.field.Checkbox', {
         me.mon(me.inputEl, 'click', me.onBoxClick, me);
     },
 
-    /**
+    /**
      * @private Handle click on the checkbox button
      */
     onBoxClick: function(e) {
@@ -263,7 +280,7 @@ Ext.define('Ext.form.field.Checkbox', {
         }
     },
 
-    /**
+    /**
      * Returns the checked state of the checkbox.
      * @return {Boolean} True if checked, else false
      */
@@ -271,7 +288,7 @@ Ext.define('Ext.form.field.Checkbox', {
         return this.checked;
     },
 
-    /**
+    /**
      * Returns the checked state of the checkbox.
      * @return {Boolean} True if checked, else false
      */
@@ -279,19 +296,17 @@ Ext.define('Ext.form.field.Checkbox', {
         return this.checked;
     },
 
-    /**
+    /**
      * Returns the submit value for the checkbox which can be used when submitting forms.
      * @return {Boolean/null} True if checked; otherwise either the {@link #uncheckedValue} or null.
      */
     getSubmitValue: function() {
-        return this.checked ? this.inputValue : (this.uncheckedValue || null);
-    },
-
-    getModelData: function() {
-        return this.getSubmitData();
+        var unchecked = this.uncheckedValue,
+            uncheckedVal = Ext.isDefined(unchecked) ? unchecked : null;
+        return this.checked ? this.inputValue : unchecked;
     },
 
-    /**
+    /**
      * Sets the checked state of the checkbox.
      * @param {Boolean/String} value The following values will check the checkbox:
      * <code>true, 'true', '1', or 'on'</code>, as well as a String that matches the {@link #inputValue}.
@@ -314,7 +329,7 @@ Ext.define('Ext.form.field.Checkbox', {
         return checked;
     },
 
-    /**
+    /**
      * Sets the checked state of the checkbox, and invokes change detection.
      * @param {Boolean/String} checked The following values will check the checkbox:
      * <code>true, 'true', '1', or 'on'</code>, as well as a String that matches the {@link #inputValue}.
@@ -345,7 +360,7 @@ Ext.define('Ext.form.field.Checkbox', {
         return value;
     },
 
-    /**
+    /**
      * @private
      * Called when the checkbox's checked state changes. Invokes the {@link #handler} callback
      * function if specified.
@@ -384,7 +399,7 @@ Ext.define('Ext.form.field.Checkbox', {
         me.readOnly = readOnly;
     },
 
-    /**
+    /**
      * @protected Calculate and return the natural width of the bodyEl. It's possible that the initial
      * rendering will cause the boxLabel to wrap and give us a bad width, so we must prevent wrapping
      * while measuring.
@@ -401,4 +416,6 @@ Ext.define('Ext.form.field.Checkbox', {
     }
 
 });
-
\ No newline at end of file +
+ +