From edc11f4f503f33ca8a4cbfadbad3493d476c1cfe Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 10 Feb 2020 14:38:08 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- roojs-all.js | 10 +++++----- roojs-debug.js | 2 +- roojs-ui-debug.js | 2 +- roojs-ui.js | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/roojs-all.js b/roojs-all.js index b6786dea1e..1e1415012e 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1771,11 +1771,11 @@ B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException if(i<1){el.setHeight(h'+this.loadingText+'':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(a,b,c,d){if(!this.hasFocus){return; }if(this.store.getCount()>0){this.expand();this.restrictHeight();}else{this.onEmptyResults();}},onLoadException:function(){this.collapse();Roo.log(this.store.reader.jsonData);if(this.store&&typeof(this.store.reader.jsonData.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg); -}},onSelectChange:function(A,B,C){var ix=A.getSelectedIndexes();if(C.list>this.maxColumns-2){this.setFromData(ix.length?A.store.getAt(ix[0]).data:{});return;}if(!ix.length){this.setFromData({});var D=this.stores[C.list+1];D.loadData(D.reader.readerType=='json'?{data:[]} -:[]);return;}var E=A.store.getAt(ix[0]);this.setFromData(E.data);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);var F=typeof(E.data.cn)=='undefined'?[]:E.data.cn; -var dl=typeof(F.data)!='undefined'?F.total:F.length;this.stores[C.list+1].loadData(F);this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[C.list+1].getEl().setStyle({display:dl?'block':'none'});this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight()); -this.list.setWidth(lw*(C.list+(dl?2:1)));},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()>0){A.each(function(r){if(r.data[B]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){D.loadData(r.data.cn);var G=E.findRecordInStore(D,B,C);if(G!==false){F=G;return false;}}return true;});}return F;}}); +}},onSelectChange:function(A,B,C){var ix=A.getSelectedIndexes();if(C.list>this.maxColumns-2){this.setFromData(ix.length?A.store.getAt(ix[0]).data:{});return;}if(!ix.length){this.setFromData({});var D=this.stores[C.list+1];D.removeAll();return;}var E=A.store.getAt(ix[0]); +this.setFromData(E.data);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);var F=typeof(E.data.cn)=='undefined'?[]:E.data.cn;var dl=typeof(F.data)!='undefined'?F.total:F.length; +this.stores[C.list+1].loadData(F);this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[C.list+1].getEl().setStyle({display:dl?'block':'none'});this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight());this.list.setWidth(lw*(C.list+(dl?2:1))); +},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()>0){A.each(function(r){if(r.data[B]==C){F=r; +return false;}if(r.data.cn&&r.data.cn.length){D.loadData(r.data.cn);var G=E.findRecordInStore(D,B,C);if(G!==false){F=G;return false;}}return true;});}return F;}}); // 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 f27070116b..65e095afa0 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -42970,7 +42970,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { if (!ix.length) { this.setFromData({}); var str = this.stores[opts.list+1]; - str.loadData( str.reader.readerType == 'json' ? { data : [] } : [] ); + str.removeAll(); return; } diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 6e92abc16a..651fd3b133 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -20486,7 +20486,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { if (!ix.length) { this.setFromData({}); var str = this.stores[opts.list+1]; - str.loadData( str.reader.readerType == 'json' ? { data : [] } : [] ); + str.removeAll(); return; } diff --git a/roojs-ui.js b/roojs-ui.js index ddee8663ba..f678f066b6 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -901,11 +901,11 @@ B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException if(i<1){el.setHeight(h'+this.loadingText+'':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(a,b,c,d){if(!this.hasFocus){return; }if(this.store.getCount()>0){this.expand();this.restrictHeight();}else{this.onEmptyResults();}},onLoadException:function(){this.collapse();Roo.log(this.store.reader.jsonData);if(this.store&&typeof(this.store.reader.jsonData.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg); -}},onSelectChange:function(A,B,C){var ix=A.getSelectedIndexes();if(C.list>this.maxColumns-2){this.setFromData(ix.length?A.store.getAt(ix[0]).data:{});return;}if(!ix.length){this.setFromData({});var D=this.stores[C.list+1];D.loadData(D.reader.readerType=='json'?{data:[]} -:[]);return;}var E=A.store.getAt(ix[0]);this.setFromData(E.data);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);var F=typeof(E.data.cn)=='undefined'?[]:E.data.cn; -var dl=typeof(F.data)!='undefined'?F.total:F.length;this.stores[C.list+1].loadData(F);this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[C.list+1].getEl().setStyle({display:dl?'block':'none'});this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight()); -this.list.setWidth(lw*(C.list+(dl?2:1)));},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()>0){A.each(function(r){if(r.data[B]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){D.loadData(r.data.cn);var G=E.findRecordInStore(D,B,C);if(G!==false){F=G;return false;}}return true;});}return F;}}); +}},onSelectChange:function(A,B,C){var ix=A.getSelectedIndexes();if(C.list>this.maxColumns-2){this.setFromData(ix.length?A.store.getAt(ix[0]).data:{});return;}if(!ix.length){this.setFromData({});var D=this.stores[C.list+1];D.removeAll();return;}var E=A.store.getAt(ix[0]); +this.setFromData(E.data);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);var F=typeof(E.data.cn)=='undefined'?[]:E.data.cn;var dl=typeof(F.data)!='undefined'?F.total:F.length; +this.stores[C.list+1].loadData(F);this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[C.list+1].getEl().setStyle({display:dl?'block':'none'});this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight());this.list.setWidth(lw*(C.list+(dl?2:1))); +},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()>0){A.each(function(r){if(r.data[B]==C){F=r; +return false;}if(r.data.cn&&r.data.cn.length){D.loadData(r.data.cn);var G=E.findRecordInStore(D,B,C);if(G!==false){F=G;return false;}}return true;});}return F;}}); // 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