From: edward Date: Mon, 18 Jul 2016 06:06:19 +0000 (+0800) Subject: roojs-ui.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=ee32c3dc2d8e1f8c4c7703cf38c254c133e91fee roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- diff --git a/roojs-all.js b/roojs-all.js index 134407266e..3caa459520 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1685,7 +1685,7 @@ if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});}this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff; }return this.valueOff;},onClick:function(){if(this.disabled){return;}this.setChecked(!this.checked);},setValue:function(v,A){this.setChecked(String(v)===String(this.inputValue),A);},setChecked:function(A,B){if(this.inSetChecked){this.checked=A;return;}if(this.wrap){this.wrap[A?'addClass':'removeClass']('x-menu-item-checked'); }this.checked=A;if(B!==true){this.fireEvent('check',this,A);}this.inSetChecked=true;this.el.dom.value=A?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;}this.setValue(this.el.dom.value);},onDestroy:function(){if(this.viewEl){Roo.get(this.viewEl).remove(); -}Roo.form.Checkbox.superclass.onDestroy.call(this);}}); +}Roo.form.Checkbox.superclass.onDestroy.call(this);},setBoxLabel:function(A){this.wrap.select('.x-form-cb-label',true).first().dom.innerHTML=A;}}); // Roo/form/Radio.js Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.form.Radio,Roo.form.Checkbox,{inputType:'radio',getGroupValue:function(){return this.el.up('form').child('input[name='+this.el.dom.name+']:checked',true).value; },onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue;}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel} diff --git a/roojs-debug.js b/roojs-debug.js index 635f468eb8..0a1f03f4b2 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -41110,6 +41110,11 @@ Roo.extend(Roo.form.Checkbox, Roo.form.Field, { } Roo.form.Checkbox.superclass.onDestroy.call(this); + }, + + setBoxLabel : function(str) + { + this.wrap.select('.x-form-cb-label', true).first().dom.innerHTML = str; } });/* diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 91e15146f8..89dc69d6ab 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -24637,6 +24637,11 @@ Roo.extend(Roo.form.Checkbox, Roo.form.Field, { } Roo.form.Checkbox.superclass.onDestroy.call(this); + }, + + setBoxLabel : function(str) + { + this.wrap.select('.x-form-cb-label', true).first().dom.innerHTML = str; } });/* diff --git a/roojs-ui.js b/roojs-ui.js index 7f28c618dc..6c70b1eb16 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1015,7 +1015,7 @@ if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});}this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff; }return this.valueOff;},onClick:function(){if(this.disabled){return;}this.setChecked(!this.checked);},setValue:function(v,A){this.setChecked(String(v)===String(this.inputValue),A);},setChecked:function(A,B){if(this.inSetChecked){this.checked=A;return;}if(this.wrap){this.wrap[A?'addClass':'removeClass']('x-menu-item-checked'); }this.checked=A;if(B!==true){this.fireEvent('check',this,A);}this.inSetChecked=true;this.el.dom.value=A?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;}this.setValue(this.el.dom.value);},onDestroy:function(){if(this.viewEl){Roo.get(this.viewEl).remove(); -}Roo.form.Checkbox.superclass.onDestroy.call(this);}}); +}Roo.form.Checkbox.superclass.onDestroy.call(this);},setBoxLabel:function(A){this.wrap.select('.x-form-cb-label',true).first().dom.innerHTML=A;}}); // Roo/form/Radio.js Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.form.Radio,Roo.form.Checkbox,{inputType:'radio',getGroupValue:function(){return this.el.up('form').child('input[name='+this.el.dom.name+']:checked',true).value; },onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue;}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel}