From 3c7ad4e256b355ce99f93f7302ed5f2828b27ce5 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 10 Feb 2020 15:56:17 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js Roo/form/ComboNested.js --- Roo/form/ComboNested.js | 4 ++-- roojs-all.js | 2 +- roojs-debug.js | 11 +++++------ roojs-ui-debug.js | 11 +++++------ roojs-ui.js | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Roo/form/ComboNested.js b/Roo/form/ComboNested.js index 04b31717b5..f5f67f2c30 100644 --- a/Roo/form/ComboNested.js +++ b/Roo/form/ComboNested.js @@ -375,7 +375,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { var prop = this.hiddenName; var store = this.stores[lvl]; if(store.getCount() < 1){ - return false; + return; } var record = false; store.each(function(r){ @@ -399,7 +399,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { return true; }); - + } diff --git a/roojs-all.js b/roojs-all.js index bbe4029863..b03c62b77a 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1777,7 +1777,7 @@ this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.view }},onDoubleClick:function(){this.collapse();},findRecord:function(A,B){return this.findRecordInStore(this.store,A,B);},findRecordInStore:function(A,B,C){var D=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});var E=this;var F=false;if(A.getCount()<1){return false; }A.each(function(r){if(r.data[B]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){D.loadDataFromChildren(r);var G=E.findRecordInStore(D,B,C);if(G!==false){F=G;return false;}}return true;});return F;},selectActive:function(A){var B=new Roo.data.SimpleStore({reader:this.store.reader,data:[]} );var C=this.getValue();var D=this.hiddenName;var E=this.stores[A];if(E.getCount()<1){return false;}var F=false;E.each(function(r){if(r.data[D]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){B.loadDataFromChildren(r);var G=_this.findRecordInStore(B,D,C); -if(G!==false){F=r;return false;}}return true;});if(F!==false){var ix=E.getIndexOf(F);this.views[A].function(ix,false,true);}}}); +if(G!==false){var ix=E.getIndexOf(r);this.views[A].select(ix,false,true);this.store.loadDataFromChildren(r);this.selectActive(A+1);return false;}}return true;});}}); // Roo/form/Checkbox.js Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"} ,boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments); diff --git a/roojs-debug.js b/roojs-debug.js index 36c2ce6ba3..ae94324a2d 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -43093,18 +43093,17 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { cstore.loadDataFromChildren( r); var cret = _this.findRecordInStore(cstore, prop, value); if (cret !== false) { - record = r; + var ix = store.getIndexOf(r); + this.views[lvl].select(ix, false, true); // will not trigger select change.. + this.store.loadDataFromChildren(r); // will trigger load. + this.selectActive(lvl+1); return false; } } return true; }); - if (record !== false) { - var ix = store.getIndexOf(record); - this.views[lvl].function(ix, false, true); // will not trigger select change.. - } - + } diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 86247349dd..72e4eeb94c 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -20609,18 +20609,17 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { cstore.loadDataFromChildren( r); var cret = _this.findRecordInStore(cstore, prop, value); if (cret !== false) { - record = r; + var ix = store.getIndexOf(r); + this.views[lvl].select(ix, false, true); // will not trigger select change.. + this.store.loadDataFromChildren(r); // will trigger load. + this.selectActive(lvl+1); return false; } } return true; }); - if (record !== false) { - var ix = store.getIndexOf(record); - this.views[lvl].function(ix, false, true); // will not trigger select change.. - } - + } diff --git a/roojs-ui.js b/roojs-ui.js index fe5784ed55..fcb749642d 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -907,7 +907,7 @@ this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.view }},onDoubleClick:function(){this.collapse();},findRecord:function(A,B){return this.findRecordInStore(this.store,A,B);},findRecordInStore:function(A,B,C){var D=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});var E=this;var F=false;if(A.getCount()<1){return false; }A.each(function(r){if(r.data[B]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){D.loadDataFromChildren(r);var G=E.findRecordInStore(D,B,C);if(G!==false){F=G;return false;}}return true;});return F;},selectActive:function(A){var B=new Roo.data.SimpleStore({reader:this.store.reader,data:[]} );var C=this.getValue();var D=this.hiddenName;var E=this.stores[A];if(E.getCount()<1){return false;}var F=false;E.each(function(r){if(r.data[D]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){B.loadDataFromChildren(r);var G=_this.findRecordInStore(B,D,C); -if(G!==false){F=r;return false;}}return true;});if(F!==false){var ix=E.getIndexOf(F);this.views[A].function(ix,false,true);}}}); +if(G!==false){var ix=E.getIndexOf(r);this.views[A].select(ix,false,true);this.store.loadDataFromChildren(r);this.selectActive(A+1);return false;}}return true;});}}); // Roo/form/Checkbox.js Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"} ,boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments); -- 2.39.2