Fix #6465 - drag drop for cards
[roojs1] / Roo / bootstrap / Radio.js
index 0d0f7a8..cddcdd1 100644 (file)
@@ -10,7 +10,7 @@
  * @extends Roo.bootstrap.Component
  * Bootstrap Radio class
  * @cfg {String} boxLabel - the label associated
- * @cfg {String} inputValue - the value of radio
+ * @cfg {String} value - the value of radio
  * 
  * @constructor
  * Create a new Radio
@@ -25,7 +25,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.Component, {
     
     boxLabel : '',
     
-    inputValue : '',
+    value : '',
     
     getAutoCreate : function()
     {
@@ -36,7 +36,7 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.Component, {
                 {
                     tag : 'label',
                     cls : 'box-label',
-                    html : this.inputValue
+                    html : this.boxLabel
                 }
             ]
         };
@@ -52,19 +52,26 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.Component, {
         
     },
     
-    onClick : function()
+    onClick : function(e)
     {
-        this.setChecked(true);
+        if(this.parent().fireEvent('click', this.parent(), this, e) !== false){
+            this.setChecked(true);
+        }
     },
     
     setChecked : function(state, suppressEvent)
     {
-        this.parent().setValue(this.inputValue);
+        this.parent().setValue(this.value, suppressEvent);
         
-        if(suppressEvent !== true){
-            this.fireEvent('check', this, state);
-        }
+    },
+    
+    setBoxLabel : function(v)
+    {
+        this.boxLabel = v;
         
+        if(this.rendered){
+            this.el.select('label.box-label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+        }
     }
     
 });