fix combocheck trim disabled
authorAlan <alan@roojs.com>
Wed, 7 Jun 2023 05:15:11 +0000 (13:15 +0800)
committerAlan <alan@roojs.com>
Wed, 7 Jun 2023 05:15:11 +0000 (13:15 +0800)
docs/src/Roo_form_ComboCheck.js.html
roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 71c9979..4fa7fb4 100644 (file)
         });
     },
 
+    </span><span class="jsdoc-var">cleanLeadingSpace </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">e</span><span class="jsdoc-syntax">)
+    {
+        </span><span class="jsdoc-comment">// this is disabled, as it retriggers setvalue on blur
+        </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
+    },
     </span><span class="jsdoc-var">onViewOver </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">e</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">t</span><span class="jsdoc-syntax">){
         </span><span class="jsdoc-comment">// do nothing...
         </span><span class="jsdoc-keyword">return</span><span class="jsdoc-syntax">;
index 5efe5ae..ca8539b 100644 (file)
@@ -2360,13 +2360,13 @@ r2+='<td><img class="x-menu-item-icon" src="'+Roo.BLANK_IMAGE_URL+'"></td>';}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:'<div class="'+B+'-item x-menu-check-item">'+'<img class="x-menu-item-icon" style="margin: 0px;" src="'+Roo.BLANK_IMAGE_URL+'">'+'<span>{'+this.displayField+'}</span>'+'</div>'}
 );}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'}
index 45870b5..87e59c9 100644 (file)
@@ -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;
index 4268b48..18d15ea 100644 (file)
@@ -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;
index ced5864..bdb3a81 100644 (file)
@@ -1413,13 +1413,13 @@ r2+='<td><img class="x-menu-item-icon" src="'+Roo.BLANK_IMAGE_URL+'"></td>';}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:'<div class="'+B+'-item x-menu-check-item">'+'<img class="x-menu-item-icon" style="margin: 0px;" src="'+Roo.BLANK_IMAGE_URL+'">'+'<span>{'+this.displayField+'}</span>'+'</div>'}
 );}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'}