Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / Checkbox.js
index 2279978..85903b8 100644 (file)
@@ -146,6 +146,9 @@ Roo.extend(Roo.form.Checkbox, Roo.form.Field,  {
 
        // private
     onClick : function(){ 
+        if (this.disabled) {
+            return;
+        }
         this.setChecked(!this.checked);
 
         //if(this.el.dom.checked != this.checked){
@@ -156,7 +159,8 @@ Roo.extend(Roo.form.Checkbox, Roo.form.Field,  {
     /**
      * Sets the checked state of the checkbox.
      * On is always based on a string comparison between inputValue and the param.
-     * @param {Boolean/String} checked 
+     * @param {Boolean/String} value - the value to set 
+     * @param {Boolean/String} suppressEvent - whether to suppress the checkchange event.
      */
     setValue : function(v,suppressEvent){
         
@@ -166,7 +170,7 @@ Roo.extend(Roo.form.Checkbox, Roo.form.Field,  {
         //    this.el.dom.checked = this.checked;
         //    this.el.dom.defaultChecked = this.checked;
         //}
-        this.setChecked(String(v) === String(this.inputValue));
+        this.setChecked(String(v) === String(this.inputValue), suppressEvent);
         //this.fireEvent("check", this, this.checked);
     },
     // private..
@@ -183,7 +187,7 @@ Roo.extend(Roo.form.Checkbox, Roo.form.Field,  {
         }
         this.checked = state;
         if(suppressEvent !== true){
-            this.fireEvent('checkchange', this, state);
+            this.fireEvent('check', this, state);
         }
         this.inSetChecked = true;
         this.el.dom.value = state ? this.inputValue : this.valueOff;