sync
[roojs1] / Roo / bootstrap / CheckBox.js
index 92c1db4..ec0d284 100644 (file)
@@ -234,6 +234,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
                 html: this.boxLabel
             };
             
+            if(this.useFontAwesomeCheckBox) {
+                boxLabelCfg.cls = 'box-label fa-checkbox'
+            }
+            
             if(this.tooltip){
                 boxLabelCfg.tooltip = this.tooltip;
             }
@@ -393,6 +397,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     
     validate : function()
     {
+        if(this.getVisibilityEl().hasClass('hidden')){
+            return true;
+        }
+        
         if(
                 this.disabled || 
                 (this.inputType == 'radio' && this.validateRadio()) ||
@@ -408,6 +416,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     
     validateRadio : function()
     {
+        if(this.getVisibilityEl().hasClass('hidden')){
+            return true;
+        }
+        
         if(this.allowBlank){
             return true;
         }
@@ -443,9 +455,12 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         var r = false;
         
         for(var i in group){
-            if(group[i].el.isVisible()){
-                
+            if(group[i].el.isVisible(true)){
+                r = false;
+                break;
             }
+            
+            r = true;
         }
         
         for(var i in group){
@@ -565,7 +580,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         
         var label = Roo.bootstrap.FieldLabel.get(this.name + '-group');
         
-        if (label) {
+        if (label && label.iconEl) {
             label.iconEl.removeClass(label.validClass);
             label.iconEl.removeClass(label.invalidClass);
         }
@@ -611,6 +626,15 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         this.disabled = false;
         this.fireEvent("enable", this);
         return this;
+    },
+    
+    setBoxLabel : function(v)
+    {
+        this.boxLabel = v;
+        
+        if(this.rendered){
+            this.el.select('label.box-label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+        }
     }
 
 });