From: Alan Date: Wed, 7 Jun 2023 05:20:05 +0000 (+0800) Subject: fix combocheck blanking fix X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=c4f83071636e99c39ba18e6c84065e8a08a117b6 fix combocheck blanking fix --- diff --git a/docs/src/Roo_form_ComboCheck.js.html b/docs/src/Roo_form_ComboCheck.js.html index 4fa7fb438b..aa2fcfafdc 100644 --- a/docs/src/Roo_form_ComboCheck.js.html +++ b/docs/src/Roo_form_ComboCheck.js.html @@ -86,6 +86,10 @@ // this is disabled, as it retriggers setvalue on blur return; }, + doForce : function() { + // no idea what this did, but it blanks out our values. + return; + }, onViewOver : function(e, t){ // do nothing... return; diff --git a/roojs-all.js b/roojs-all.js index ca8539b22a..b08c0b8f56 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2360,7 +2360,7 @@ 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(); -}});},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; +}});},cleanLeadingSpace:function(e){return;},doForce:function(){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; diff --git a/roojs-debug.js b/roojs-debug.js index 87e59c91c9..be44d20920 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -56940,6 +56940,10 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, { // this is disabled, as it retriggers setvalue on blur return; }, + doForce : function() { + // no idea what this did, but it blanks out our values. + return; + }, onViewOver : function(e, t){ // do nothing... return; diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 18d15eadf4..637e16aa9d 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -32438,6 +32438,10 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, { // this is disabled, as it retriggers setvalue on blur return; }, + doForce : function() { + // no idea what this did, but it blanks out our values. + return; + }, onViewOver : function(e, t){ // do nothing... return; diff --git a/roojs-ui.js b/roojs-ui.js index bdb3a81cf2..dfa72aa225 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1413,7 +1413,7 @@ 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(); -}});},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; +}});},cleanLeadingSpace:function(e){return;},doForce:function(){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;