Roo/bootstrap/CheckBox.js
authorEdward <edward@roojs.com>
Fri, 13 Jun 2014 04:42:22 +0000 (12:42 +0800)
committerEdward <edward@roojs.com>
Fri, 13 Jun 2014 04:42:22 +0000 (12:42 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 4441f85..bb55033 100644 (file)
@@ -211,7 +211,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     {
         Roo.log('run');
         Roo.log(this.fieldLabel);
-        Roo.log(this.inputValue());
+        Roo.log(this.inputValue);
         this.setChecked(((typeof(v) == 'undefined') ? this.checked : (String(v) === String(this.inputValue))), suppressEvent);
     }
     
index 6c46032..b8081c7 100644 (file)
@@ -12576,7 +12576,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
     {
         Roo.log('run');
         Roo.log(this.fieldLabel);
-        Roo.log(this.inputValue());
+        Roo.log(this.inputValue);
         this.setChecked(((typeof(v) == 'undefined') ? this.checked : (String(v) === String(this.inputValue))), suppressEvent);
     }
     
index e017aa2..8703044 100644 (file)
@@ -281,7 +281,7 @@ this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getHeight()
 //Roo/bootstrap/CheckBox.js
 Roo.bootstrap.CheckBox=function(A){Roo.bootstrap.CheckBox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.bootstrap.CheckBox,Roo.bootstrap.Input,{inputType:'checkbox',inputValue:1,valueOff:0,boxLabel:false,checked:false,getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;var id=Roo.id();var B={};B.cls='form-group'var C={tag:'input',id:id,type:this.inputType,value:(!this.checked)?this.valueOff:this.inputValue,cls:'form-box',placeholder:this.placeholder||''};if(this.disabled){C.disabled=true;}if(this.checked){C.checked=this.checked;}if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}var D=this;['xs','sm','md','lg'].map(function(F){if(D[F]){B.cls+=' col-'+F+'-'+D[F];}});var E=C;if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
 E.cn.push(C);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");B.cn=[{tag:'label','for':id,cls:'control-label col-md-'+this.labelWidth,html:this.fieldLabel},{cls:"col-md-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel},E];}else {Roo.log(" no label && no align");B.cn=[E];};if(this.boxLabel){B.cn.push({tag:'label','for':id,cls:'box-label',html:this.boxLabel})}return B;},inputEl:function(){return this.el.select('input.form-box',true).first();},initEvents:function(){this.inputEl().on('click',this.onClick,this);},onClick:function(){this.setChecked(!this.checked);},setChecked:function(A,B){this.checked=A;this.inputEl().dom.checked=A;if(B!==true){this.fireEvent('check',this,A);}
-this.inputEl().dom.value=A?this.inputValue:this.valueOff;},setValue:function(v,A){Roo.log('run');Roo.log(this.fieldLabel);Roo.log(this.inputValue());this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);}});
+this.inputEl().dom.value=A?this.inputValue:this.valueOff;},setValue:function(v,A){Roo.log('run');Roo.log(this.fieldLabel);Roo.log(this.inputValue);this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);}});
 //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;var id=Roo.id();var B={};B.cls='form-group'var C={tag:'input',id:id,type:this.inputType,value:(!this.checked)?this.valueOff:this.inputValue,cls:'form-box',placeholder:this.placeholder||''};if(this.disabled){C.disabled=true;}if(this.checked){C.checked=this.checked;}if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}var D=this;['xs','sm','md','lg'].map(function(F){if(D[F]){B.cls+=' col-'+F+'-'+D[F];}});var E=C;if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
 E.cn.push(C);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");B.cn=[{tag:'label','for':id,cls:'control-label col-md-'+this.labelWidth,html:this.fieldLabel},{cls:"col-md-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel},E];}else {Roo.log(" no label && no align");B.cn=[E];};if(this.boxLabel){B.cn.push({tag:'label','for':id,cls:'box-label',html:this.boxLabel})}return B;},onClick:function(){this.setChecked(true);},setChecked:function(A,B){Roo.each(this.inputEl().up('form').select('input[name='+this.inputEl().dom.name+']',true).elements,function(v){v.dom.checked=false;});this.checked=A;this.inputEl().dom.checked=A;if(B!==true){this.fireEvent('check',this,A);}