Roo/bootstrap/Radio.js
authorAlan Knowles <alan@roojs.com>
Thu, 30 Jul 2015 07:47:15 +0000 (15:47 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 30 Jul 2015 07:47:15 +0000 (15:47 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Radio.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index d080564..1e25319 100644 (file)
@@ -73,7 +73,8 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         var fieldLabel = {
             tag: 'span' ,
             //cls : 'control-label' + inline,
-            html : this.fieldLabel 
+            html : this.fieldLabel,
+            style : 'width:' +  this.fieldWidth  + 'px'
         };
         
  
index ae09c49..e45ac2b 100644 (file)
@@ -16483,10 +16483,10 @@ Roo.extend(Roo.bootstrap.Radio, Roo.bootstrap.CheckBox,  {
         };
         
         var fieldLabel = {
-            tag: 'label' ,
-            cls : 'control-label' + inline,
+            tag: 'span' ,
+            //cls : 'control-label' + inline,
             html : this.fieldLabel,
-            style : 'cursor:default'
+            style : 'width:' +  this.fieldWidth  + 'px'
         };
         
  
index 53f2a3e..d66804d 100644 (file)
@@ -365,7 +365,7 @@ this.checked=A;if(B!==true){this.fireEvent('check',this,A);}
 this.inputEl().dom.checked=A;this.inputEl().dom.value=A?this.inputValue:this.valueOff;},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue();}return this.inputEl().getValue();},getGroupValue:function(){return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A);return;}
 this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);},setGroupValue:function(v,A){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true);}return;}});
 //Roo/bootstrap/Radio.js
-Roo.bootstrap.Radio=function(A){Roo.bootstrap.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Radio,Roo.bootstrap.CheckBox,{inputType:'radio',inputValue:'',valueOff:'',getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;A=A||'left';var id=Roo.id();var B={tag:this.inline?'span':'div',cls:'',cn:[]};var C=this.inline?' radio-inline':'';var D={tag:'label','for':id,cls:'control-label box-label'+C,cn:[]};var E={tag:'label',cls:'control-label'+C,html:this.fieldLabel,style:'cursor:default'};var F={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-radio',placeholder:this.placeholder||''};if(this.weight){F.cls+=" radio-"+this.weight;}if(this.disabled){F.disabled=true;}if(this.checked){F.checked=this.checked;}if(this.name){F.name=this.name;}if(this.size){F.cls+=' input-'+this.size;}var G=this;['xs','sm','md','lg'].map(function(J){if(G[J]){B.cls+=' col-'+J+'-'+G[J];}});var H=F;if(this.before||this.after){H={cls:'input-group',tag:'span',cn:[]};if(this.before){H.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
+Roo.bootstrap.Radio=function(A){Roo.bootstrap.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Radio,Roo.bootstrap.CheckBox,{inputType:'radio',inputValue:'',valueOff:'',getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;A=A||'left';var id=Roo.id();var B={tag:this.inline?'span':'div',cls:'',cn:[]};var C=this.inline?' radio-inline':'';var D={tag:'label','for':id,cls:'control-label box-label'+C,cn:[]};var E={tag:'span',html:this.fieldLabel,style:'width:'+this.fieldWidth+'px'};var F={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-radio',placeholder:this.placeholder||''};if(this.weight){F.cls+=" radio-"+this.weight;}if(this.disabled){F.disabled=true;}if(this.checked){F.checked=this.checked;}if(this.name){F.name=this.name;}if(this.size){F.cls+=' input-'+this.size;}var G=this;['xs','sm','md','lg'].map(function(J){if(G[J]){B.cls+=' col-'+J+'-'+G[J];}});var H=F;if(this.before||this.after){H={cls:'input-group',tag:'span',cn:[]};if(this.before){H.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
 H.cn.push(F);if(this.after){H.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};if(this.fieldLabel&&this.fieldLabel.length){B.cn.push(E);}var I={tag:'span',cls:'radio'+C,cn:[H,D]};B.cn.push(I);if(this.boxLabel){D.cn.push({tag:'span',html:this.boxLabel})}return B;},initEvents:function(){this.inputEl().on('click',this.onClick,this);if(this.boxLabel){Roo.log('find label')
 this.el.select('span.radio label span',true).first().on('click',this.onClick,this);}},inputEl:function(){return this.el.select('input.roo-radio',true).first();},onClick:function(){Roo.log("click");this.setChecked(true);},setChecked:function(A,B){if(A){Roo.each(this.inputEl().up('form').select('input[name='+this.inputEl().dom.name+']',true).elements,function(v){v.dom.checked=false;});}
 Roo.log(this.inputEl().dom);this.checked=A;this.inputEl().dom.checked=A;if(B!==true){this.fireEvent('check',this,A);}},getGroupValue:function(){var A=''Roo.each(this.inputEl().up('form').select('input[name='+this.inputEl().dom.name+']',true).elements,function(v){if(v.dom.checked==true){A=v.dom.value;}});return A;},getValue:function(){return this.getGroupValue();}});