From: Alan Date: Wed, 7 Jun 2023 05:15:11 +0000 (+0800) Subject: fix combocheck trim disabled X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=204b33a67848e3d80aaa90af2b0e8c887eccf2ea fix combocheck trim disabled --- diff --git a/docs/src/Roo_form_ComboCheck.js.html b/docs/src/Roo_form_ComboCheck.js.html index 71c99790f8..4fa7fb438b 100644 --- a/docs/src/Roo_form_ComboCheck.js.html +++ b/docs/src/Roo_form_ComboCheck.js.html @@ -81,6 +81,11 @@ }); }, + cleanLeadingSpace : function(e) + { + // this is disabled, as it retriggers setvalue on blur + return; + }, onViewOver : function(e, t){ // do nothing... return; diff --git a/roojs-all.js b/roojs-all.js index 5efe5aed52..ca8539b22a 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2360,13 +2360,13 @@ r2+='';}var Roo.form.ComboCheck=function(A){Roo.form.ComboCheck.superclass.constructor.call(this,A);var B=['hiddenName','displayField','valueField'];var _t=this;Roo.each(B,function(e){if((typeof(_t[e])=='undefined')||!_t[e].length){throw "Roo.form.ComboCheck : missing value for: "+e; }});};Roo.extend(Roo.form.ComboCheck,Roo.form.ComboBox,{editable:false,selectedClass:'x-menu-item-checked',onRender:function(ct,A){var _t=this;if(!this.tpl){var B='x-combo-list';this.tpl=new Roo.Template({html:'
'+''+'{'+this.displayField+'}'+'
'} );}Roo.form.ComboCheck.superclass.onRender.call(this,ct,A);this.view.singleSelect=false;this.view.multiSelect=true;this.view.toggleSelect=true;this.pageTb.add(new Roo.Toolbar.Fill(),{text:'Select All',handler:function(){_t.selectAll();}},{text:'Done',handler:function(){_t.collapse(); -}});},onViewOver:function(e,t){return;},onViewClick:function(A,B){return;},select:function(){},selectByValue:function(xv,A){var ar=this.getValueArray();var B=[];Roo.each(ar,function(v){if(v===undefined||v===null){return;}var r=this.findRecord(this.valueField,v); -if(r){B.push(this.store.indexOf(r))}},this);this.view.select(B);return false;},selectAll:function(){var A=[];this.store.each(function(r,i){A.push(i);});this.view.select(A);this.collapse();return false;},onSelect:function(A,B){this.view.clearSelections();this.setValue('[]'); -if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore);this.valueBefore=this.value;}},getValueArray:function(){var ar=[];try{if(typeof(this.value)=='undefined'){return [];}var ar=Roo.decode(this.value);return ar instanceof Array?ar:[]; -}catch(e){Roo.log(e+"\nRoo.form.ComboCheck:getValueArray invalid data:"+this.getValue());return [];}},expand:function(){Roo.form.ComboCheck.superclass.expand.call(this);this.valueBefore=typeof(this.value)=='undefined'?'':this.value;},collapse:function(){Roo.form.ComboCheck.superclass.collapse.call(this); -var sl=this.view.getSelectedIndexes();var st=this.store;var nv=[];var tv=[];var r;Roo.each(sl,function(i){r=st.getAt(i);nv.push(r.get(this.valueField));},this);this.setValue(Roo.encode(nv));if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore); -this.valueBefore=this.value;}},setValue:function(v){this.value=v;var A=this.getValueArray();var tv=[];Roo.each(A,function(k){var r=this.findRecord(this.valueField,k);if(r){tv.push(r.data[this.displayField]);}else if(this.valueNotFoundText!==undefined){tv.push(this.valueNotFoundText); -}},this);Roo.form.ComboBox.superclass.setValue.call(this,tv.join(', '));this.hiddenField.value=v;this.value=v;}}); +}});},cleanLeadingSpace:function(e){return;},onViewOver:function(e,t){return;},onViewClick:function(A,B){return;},select:function(){},selectByValue:function(xv,A){var ar=this.getValueArray();var B=[];Roo.each(ar,function(v){if(v===undefined||v===null){return; +}var r=this.findRecord(this.valueField,v);if(r){B.push(this.store.indexOf(r))}},this);this.view.select(B);return false;},selectAll:function(){var A=[];this.store.each(function(r,i){A.push(i);});this.view.select(A);this.collapse();return false;},onSelect:function(A,B){this.view.clearSelections(); +this.setValue('[]');if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore);this.valueBefore=this.value;}},getValueArray:function(){var ar=[];try{if(typeof(this.value)=='undefined'){return [];}var ar=Roo.decode(this.value); +return ar instanceof Array?ar:[];}catch(e){Roo.log(e+"\nRoo.form.ComboCheck:getValueArray invalid data:"+this.getValue());return [];}},expand:function(){Roo.form.ComboCheck.superclass.expand.call(this);this.valueBefore=typeof(this.value)=='undefined'?'':this.value; +},collapse:function(){Roo.form.ComboCheck.superclass.collapse.call(this);var sl=this.view.getSelectedIndexes();var st=this.store;var nv=[];var tv=[];var r;Roo.each(sl,function(i){r=st.getAt(i);nv.push(r.get(this.valueField));},this);this.setValue(Roo.encode(nv)); +if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore);this.valueBefore=this.value;}},setValue:function(v){this.value=v;var A=this.getValueArray();var tv=[];Roo.each(A,function(k){var r=this.findRecord(this.valueField,k); +if(r){tv.push(r.data[this.displayField]);}else if(this.valueNotFoundText!==undefined){tv.push(this.valueNotFoundText);}},this);Roo.form.ComboBox.superclass.setValue.call(this,tv.join(', '));this.hiddenField.value=v;this.value=v;}}); // Roo/form/Signature.js Roo.form.Signature=function(A){Roo.form.Signature.superclass.constructor.call(this,A);this.addEvents({'confirm':true,'reset':true});};Roo.extend(Roo.form.Signature,Roo.form.Field,{labels:{clear:"Clear",confirm:"Confirm"},width:300,height:100,allowBlank:false,signPanel:{} ,isMouseDown:false,isConfirmed:false,signatureTmp:'',defaultAutoCreate:{tag:"input",type:"hidden"},onRender:function(ct,A){Roo.form.Signature.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-signature-wrap',style:'width: '+this.width+'px',cn:{cls:'x-form-signature'} diff --git a/roojs-debug.js b/roojs-debug.js index 45870b5c68..87e59c91c9 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -56935,6 +56935,11 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, { }); }, + cleanLeadingSpace : function(e) + { + // this is disabled, as it retriggers setvalue on blur + return; + }, onViewOver : function(e, t){ // do nothing... return; diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 4268b48b88..18d15eadf4 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -32433,6 +32433,11 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, { }); }, + cleanLeadingSpace : function(e) + { + // this is disabled, as it retriggers setvalue on blur + return; + }, onViewOver : function(e, t){ // do nothing... return; diff --git a/roojs-ui.js b/roojs-ui.js index ced5864148..bdb3a81cf2 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1413,13 +1413,13 @@ r2+='';}var Roo.form.ComboCheck=function(A){Roo.form.ComboCheck.superclass.constructor.call(this,A);var B=['hiddenName','displayField','valueField'];var _t=this;Roo.each(B,function(e){if((typeof(_t[e])=='undefined')||!_t[e].length){throw "Roo.form.ComboCheck : missing value for: "+e; }});};Roo.extend(Roo.form.ComboCheck,Roo.form.ComboBox,{editable:false,selectedClass:'x-menu-item-checked',onRender:function(ct,A){var _t=this;if(!this.tpl){var B='x-combo-list';this.tpl=new Roo.Template({html:'
'+''+'{'+this.displayField+'}'+'
'} );}Roo.form.ComboCheck.superclass.onRender.call(this,ct,A);this.view.singleSelect=false;this.view.multiSelect=true;this.view.toggleSelect=true;this.pageTb.add(new Roo.Toolbar.Fill(),{text:'Select All',handler:function(){_t.selectAll();}},{text:'Done',handler:function(){_t.collapse(); -}});},onViewOver:function(e,t){return;},onViewClick:function(A,B){return;},select:function(){},selectByValue:function(xv,A){var ar=this.getValueArray();var B=[];Roo.each(ar,function(v){if(v===undefined||v===null){return;}var r=this.findRecord(this.valueField,v); -if(r){B.push(this.store.indexOf(r))}},this);this.view.select(B);return false;},selectAll:function(){var A=[];this.store.each(function(r,i){A.push(i);});this.view.select(A);this.collapse();return false;},onSelect:function(A,B){this.view.clearSelections();this.setValue('[]'); -if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore);this.valueBefore=this.value;}},getValueArray:function(){var ar=[];try{if(typeof(this.value)=='undefined'){return [];}var ar=Roo.decode(this.value);return ar instanceof Array?ar:[]; -}catch(e){Roo.log(e+"\nRoo.form.ComboCheck:getValueArray invalid data:"+this.getValue());return [];}},expand:function(){Roo.form.ComboCheck.superclass.expand.call(this);this.valueBefore=typeof(this.value)=='undefined'?'':this.value;},collapse:function(){Roo.form.ComboCheck.superclass.collapse.call(this); -var sl=this.view.getSelectedIndexes();var st=this.store;var nv=[];var tv=[];var r;Roo.each(sl,function(i){r=st.getAt(i);nv.push(r.get(this.valueField));},this);this.setValue(Roo.encode(nv));if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore); -this.valueBefore=this.value;}},setValue:function(v){this.value=v;var A=this.getValueArray();var tv=[];Roo.each(A,function(k){var r=this.findRecord(this.valueField,k);if(r){tv.push(r.data[this.displayField]);}else if(this.valueNotFoundText!==undefined){tv.push(this.valueNotFoundText); -}},this);Roo.form.ComboBox.superclass.setValue.call(this,tv.join(', '));this.hiddenField.value=v;this.value=v;}}); +}});},cleanLeadingSpace:function(e){return;},onViewOver:function(e,t){return;},onViewClick:function(A,B){return;},select:function(){},selectByValue:function(xv,A){var ar=this.getValueArray();var B=[];Roo.each(ar,function(v){if(v===undefined||v===null){return; +}var r=this.findRecord(this.valueField,v);if(r){B.push(this.store.indexOf(r))}},this);this.view.select(B);return false;},selectAll:function(){var A=[];this.store.each(function(r,i){A.push(i);});this.view.select(A);this.collapse();return false;},onSelect:function(A,B){this.view.clearSelections(); +this.setValue('[]');if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore);this.valueBefore=this.value;}},getValueArray:function(){var ar=[];try{if(typeof(this.value)=='undefined'){return [];}var ar=Roo.decode(this.value); +return ar instanceof Array?ar:[];}catch(e){Roo.log(e+"\nRoo.form.ComboCheck:getValueArray invalid data:"+this.getValue());return [];}},expand:function(){Roo.form.ComboCheck.superclass.expand.call(this);this.valueBefore=typeof(this.value)=='undefined'?'':this.value; +},collapse:function(){Roo.form.ComboCheck.superclass.collapse.call(this);var sl=this.view.getSelectedIndexes();var st=this.store;var nv=[];var tv=[];var r;Roo.each(sl,function(i){r=st.getAt(i);nv.push(r.get(this.valueField));},this);this.setValue(Roo.encode(nv)); +if(this.value!=this.valueBefore){this.fireEvent('change',this,this.value,this.valueBefore);this.valueBefore=this.value;}},setValue:function(v){this.value=v;var A=this.getValueArray();var tv=[];Roo.each(A,function(k){var r=this.findRecord(this.valueField,k); +if(r){tv.push(r.data[this.displayField]);}else if(this.valueNotFoundText!==undefined){tv.push(this.valueNotFoundText);}},this);Roo.form.ComboBox.superclass.setValue.call(this,tv.join(', '));this.hiddenField.value=v;this.value=v;}}); // Roo/form/Signature.js Roo.form.Signature=function(A){Roo.form.Signature.superclass.constructor.call(this,A);this.addEvents({'confirm':true,'reset':true});};Roo.extend(Roo.form.Signature,Roo.form.Field,{labels:{clear:"Clear",confirm:"Confirm"},width:300,height:100,allowBlank:false,signPanel:{} ,isMouseDown:false,isConfirmed:false,signatureTmp:'',defaultAutoCreate:{tag:"input",type:"hidden"},onRender:function(ct,A){Roo.form.Signature.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-signature-wrap',style:'width: '+this.width+'px',cn:{cls:'x-form-signature'}