Roo/bootstrap/RadioItem.js
authoredward <edward@roojs.com>
Fri, 17 Nov 2017 04:11:49 +0000 (12:11 +0800)
committeredward <edward@roojs.com>
Fri, 17 Nov 2017 04:11:49 +0000 (12:11 +0800)
Roo/bootstrap/RadioItem.js

index 4ae9b20..72bbca0 100644 (file)
@@ -63,7 +63,29 @@ Roo.extend(Roo.bootstrap.RadioItem, Roo.bootstrap.Component,  {
     inputEl : function()
     {
         return this.el.select('roo-radio-set-item-input', true).first();
-    }
+    },
+    
+    onClick : function()
+    {
+        this.setChecked(true);
+    },
+    
+    setChecked : function(state, suppressEvent)
+    {
+        Roo.each(this.parent().items, function(i){
+            i.checked = false;
+            i.inputEl().dom.checked = false; 
+        });
+        
+        this.checked = state;
+        this.inputEl().dom.checked = state;
+
+        if(suppressEvent !== true){
+            this.fireEvent('check', this, state);
+        }
+        //this.inputEl().dom.value = state ? this.inputValue : this.valueOff;
+        this.validate()
+    },
 });