From b8b7e1e8733ce3d36d7e29ecb1b5f182b14e209c Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 28 Feb 2020 15:54:58 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- roojs-all.js | 39 ++++++++++++++--------------- roojs-debug.js | 64 ++++++++++++++++------------------------------- roojs-ui-debug.js | 64 ++++++++++++++++------------------------------- roojs-ui.js | 39 ++++++++++++++--------------- 4 files changed, 80 insertions(+), 126 deletions(-) diff --git a/roojs-all.js b/roojs-all.js index 1d1bc770f5..08bdb71833 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1758,26 +1758,25 @@ this.el.child('div').dom.setAttribute('qtip',String.format('{0}',this.data[this. this.el.child('img').un('click',this.remove,this);this.el.remove();this.cb.updateHiddenEl();this.cb.fireEvent('remove',this.cb,this);}}}); // Roo/form/ComboNested.js Roo.form.ComboNested=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.ComboNested : missing value for: "+e; -}});};Roo.extend(Roo.form.ComboNested,Roo.form.ComboBox,{maxColumns:3,list:null,innerLists:null,views:null,stores:null,onRender:function(ct,A){Roo.form.ComboBox.superclass.onRender.call(this,ct,A);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)} -,'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var B='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[B,this.listClass].join(' '),constrain:false} -);var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:B+'-hd',html:this.title});this.assetHeight+=this.header.getHeight(); -}this.innerLists=[];this.views=[];this.stores=[];for(var i=0;i{'+this.displayField+'}',isEmpty:function(D,E){var dl=typeof(D.data)!='undefined'?D.data.length:D.length; -return dl?'has-children':'no-children'}});}var B=this.store;if(i>0){B=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});}this.stores[i]=B;var C=this.views[i]=new Roo.View(il,this.tpl,{singleSelect:true,store:B,selectedClass:this.selectedClass}); -C.getEl().setWidth(lw);C.getEl().setStyle({position:i<1?'relative':'absolute',top:0,left:(i*lw)+'px',display:i>0?'none':'block'});C.on('selectionchange',this.onSelectChange,this,{list:i});C.on('dblclick',this.onDoubleClick,this,{list:i});B.on('beforeload',this.onBeforeLoad,this); -B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException,this);},onResize:function(){},restrictHeight:function(){var mh=0;Roo.each(this.innerLists,function(il,i){var el=this.views[i].getEl();el.dom.style.height='';var A=el.dom;var h=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight); -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.removeAll();return;}var E=A.store.getAt(ix[0]); -if(!this.isLoading){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);this.stores[C.list+1].loadDataFromChildren(E);var dl=this.stores[C.list+1].getTotalCount(); -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)));if(this.isLoading){this.selectActive(C.list); -}},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;}E.each(function(r){if(r.data[D]==C){var ix=E.getIndexOf(r);this.views[A].select(ix,false,true);return false;}if(r.data.cn&&r.data.cn.length){B.loadDataFromChildren(r); -var F=_this.findRecordInStore(B,D,C);if(F!==false){var ix=E.getIndexOf(r);this.views[A].select(ix,false,false);return false;}}return true;});}}); +}});};Roo.extend(Roo.form.ComboNested,Roo.form.ComboBox,{maxColumns:3,list:null,innerLists:null,views:null,stores:null,onRender:function(ct,position){Roo.form.ComboBox.superclass.onRender.call(this,ct,position);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)} +,'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var cls='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[cls,this.listClass].join(' '),constrain:false} +);var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:cls+'-hd',html:this.title});this.assetHeight+=this.header.getHeight(); +}this.innerLists=[];this.views=[];this.stores=[];for(var i=0;i{'+this.displayField+'}',isEmpty:function(value,allValues){var dl=typeof(value.data)!='undefined'?value.data.length:value.length; +return dl?'has-children':'no-children'}});}var store=this.store;if(i>0){store=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});}this.stores[i]=store;var view=this.views[i]=new Roo.View(il,this.tpl,{singleSelect:true,store:store,selectedClass:this.selectedClass} +);view.getEl().setWidth(lw);view.getEl().setStyle({position:i<1?'relative':'absolute',top:0,left:(i*lw)+'px',display:i>0?'none':'block'});view.on('selectionchange',this.onSelectChange,this,{list:i});view.on('dblclick',this.onDoubleClick,this,{list:i});store.on('beforeload',this.onBeforeLoad,this); +store.on('load',this.onLoad,this,{list:i});store.on('loadexception',this.onLoadException,this);},onResize:function(){},restrictHeight:function(){var mh=0;Roo.each(this.innerLists,function(il,i){var el=this.views[i].getEl();el.dom.style.height='';var inner=el.dom; +var h=Math.max(inner.clientHeight,inner.offsetHeight,inner.scrollHeight);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(view,sels,opts){var ix=view.getSelectedIndexes();if(opts.list>this.maxColumns-2){this.setFromData(ix.length?view.store.getAt(ix[0]).data:{});return;}if(!ix.length){this.setFromData({});var str=this.stores[opts.list+1];str.removeAll(); +return;}var rec=view.store.getAt(ix[0]);if(!this.isLoading){this.setFromData(rec.data);}var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);this.stores[opts.list+1].loadDataFromChildren(rec); +var dl=this.stores[opts.list+1].getTotalCount();this.views[opts.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[opts.list+1].getEl().setStyle({display:dl?'block':'none'});this.innerLists[opts.list+1].setHeight(this.innerLists[0].getHeight()); +this.list.setWidth(lw*(opts.list+(dl?2:1)));if(this.isLoading){this.selectActive(opts.list);}},onDoubleClick:function(){this.collapse();},recordToStores:function(store,prop,value,stack){var cstore=new Roo.data.SimpleStore({reader:this.store.reader,data:[]} +);var _this=this;var record=false;var srec=false;if(store.getCount()<1){return false;}store.each(function(r){if(r.data[prop]==value){record=r;return false;}if(r.data.cn&&r.data.cn.length){cstore.loadDataFromChildren(r);var cret=_this.recordToStores(cstore,prop,value,stack); +if(cret!==false){record=cret;srec=r;return false;}}return true;});if(record==false){return false}stack.unshift(srec);return record;},selectActive:function(){var stack=[];var rec=this.findRecordInStore(this.store,this.hiddenName,this.getValue());}); // 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 1680bd0a69..cb92a61bfa 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -43025,13 +43025,10 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { - findRecord : function (prop,value) - { - return this.findRecordInStore(this.store, prop,value); - }, + // private - findRecordInStore : function(store, prop, value) + recordToStores : function(store, prop, value, stack) { var cstore = new Roo.data.SimpleStore({ //fields : this.store.reader.meta.fields, // we need array reader.. for @@ -43040,6 +43037,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { }); var _this = this; var record = false; + var srec = false; if(store.getCount() < 1){ return false; } @@ -43050,58 +43048,38 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { } if (r.data.cn && r.data.cn.length) { cstore.loadDataFromChildren( r); - var cret = _this.findRecordInStore(cstore, prop, value); + var cret = _this.recordToStores(cstore, prop, value, stack); if (cret !== false) { record = cret; + srec = r; return false; } } return true; }); - + if (record == false) { + return false + } + stack.unshift(srec); return record; }, + /* + * find the stack of stores that match our value. + * + * + */ - - selectActive : function (lvl) + selectActive : function () { - var cstore = new Roo.data.SimpleStore({ - //fields : this.store.reader.meta.fields, // we need array reader.. for - reader : this.store.reader, - data : [ ] - }); - // just need to determine which of the current level is selected if any.. - var value = this.getValue(); - var prop = this.hiddenName; - var store = this.stores[lvl]; - if(store.getCount() < 1){ - return; - } - store.each(function(r){ - // selected is at this level - if(r.data[prop] == value){ - var ix = store.getIndexOf(r); - this.views[lvl].select(ix, false, true); - return false; - } - - if (r.data.cn && r.data.cn.length) { - cstore.loadDataFromChildren(r); - var cret = _this.findRecordInStore(cstore, prop, value); - if (cret !== false) { - var ix = store.getIndexOf(r); - this.views[lvl].select(ix, false, false); // will trigger select change.. - return false; - } - } - - return true; - }); - - } + var stack = []; + var rec = this.findRecordInStore(this.store, this.hiddenName, this.getValue()); + + + + diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 929f084a97..848de63fc9 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -20541,13 +20541,10 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { - findRecord : function (prop,value) - { - return this.findRecordInStore(this.store, prop,value); - }, + // private - findRecordInStore : function(store, prop, value) + recordToStores : function(store, prop, value, stack) { var cstore = new Roo.data.SimpleStore({ //fields : this.store.reader.meta.fields, // we need array reader.. for @@ -20556,6 +20553,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { }); var _this = this; var record = false; + var srec = false; if(store.getCount() < 1){ return false; } @@ -20566,58 +20564,38 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { } if (r.data.cn && r.data.cn.length) { cstore.loadDataFromChildren( r); - var cret = _this.findRecordInStore(cstore, prop, value); + var cret = _this.recordToStores(cstore, prop, value, stack); if (cret !== false) { record = cret; + srec = r; return false; } } return true; }); - + if (record == false) { + return false + } + stack.unshift(srec); return record; }, + /* + * find the stack of stores that match our value. + * + * + */ - - selectActive : function (lvl) + selectActive : function () { - var cstore = new Roo.data.SimpleStore({ - //fields : this.store.reader.meta.fields, // we need array reader.. for - reader : this.store.reader, - data : [ ] - }); - // just need to determine which of the current level is selected if any.. - var value = this.getValue(); - var prop = this.hiddenName; - var store = this.stores[lvl]; - if(store.getCount() < 1){ - return; - } - store.each(function(r){ - // selected is at this level - if(r.data[prop] == value){ - var ix = store.getIndexOf(r); - this.views[lvl].select(ix, false, true); - return false; - } - - if (r.data.cn && r.data.cn.length) { - cstore.loadDataFromChildren(r); - var cret = _this.findRecordInStore(cstore, prop, value); - if (cret !== false) { - var ix = store.getIndexOf(r); - this.views[lvl].select(ix, false, false); // will trigger select change.. - return false; - } - } - - return true; - }); - - } + var stack = []; + var rec = this.findRecordInStore(this.store, this.hiddenName, this.getValue()); + + + + diff --git a/roojs-ui.js b/roojs-ui.js index 5b763f3f12..f22ceb5fe6 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -888,26 +888,25 @@ this.el.child('div').dom.setAttribute('qtip',String.format('{0}',this.data[this. this.el.child('img').un('click',this.remove,this);this.el.remove();this.cb.updateHiddenEl();this.cb.fireEvent('remove',this.cb,this);}}}); // Roo/form/ComboNested.js Roo.form.ComboNested=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.ComboNested : missing value for: "+e; -}});};Roo.extend(Roo.form.ComboNested,Roo.form.ComboBox,{maxColumns:3,list:null,innerLists:null,views:null,stores:null,onRender:function(ct,A){Roo.form.ComboBox.superclass.onRender.call(this,ct,A);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)} -,'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var B='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[B,this.listClass].join(' '),constrain:false} -);var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:B+'-hd',html:this.title});this.assetHeight+=this.header.getHeight(); -}this.innerLists=[];this.views=[];this.stores=[];for(var i=0;i{'+this.displayField+'}',isEmpty:function(D,E){var dl=typeof(D.data)!='undefined'?D.data.length:D.length; -return dl?'has-children':'no-children'}});}var B=this.store;if(i>0){B=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});}this.stores[i]=B;var C=this.views[i]=new Roo.View(il,this.tpl,{singleSelect:true,store:B,selectedClass:this.selectedClass}); -C.getEl().setWidth(lw);C.getEl().setStyle({position:i<1?'relative':'absolute',top:0,left:(i*lw)+'px',display:i>0?'none':'block'});C.on('selectionchange',this.onSelectChange,this,{list:i});C.on('dblclick',this.onDoubleClick,this,{list:i});B.on('beforeload',this.onBeforeLoad,this); -B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException,this);},onResize:function(){},restrictHeight:function(){var mh=0;Roo.each(this.innerLists,function(il,i){var el=this.views[i].getEl();el.dom.style.height='';var A=el.dom;var h=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight); -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.removeAll();return;}var E=A.store.getAt(ix[0]); -if(!this.isLoading){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);this.stores[C.list+1].loadDataFromChildren(E);var dl=this.stores[C.list+1].getTotalCount(); -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)));if(this.isLoading){this.selectActive(C.list); -}},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;}E.each(function(r){if(r.data[D]==C){var ix=E.getIndexOf(r);this.views[A].select(ix,false,true);return false;}if(r.data.cn&&r.data.cn.length){B.loadDataFromChildren(r); -var F=_this.findRecordInStore(B,D,C);if(F!==false){var ix=E.getIndexOf(r);this.views[A].select(ix,false,false);return false;}}return true;});}}); +}});};Roo.extend(Roo.form.ComboNested,Roo.form.ComboBox,{maxColumns:3,list:null,innerLists:null,views:null,stores:null,onRender:function(ct,position){Roo.form.ComboBox.superclass.onRender.call(this,ct,position);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)} +,'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var cls='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[cls,this.listClass].join(' '),constrain:false} +);var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:cls+'-hd',html:this.title});this.assetHeight+=this.header.getHeight(); +}this.innerLists=[];this.views=[];this.stores=[];for(var i=0;i{'+this.displayField+'}',isEmpty:function(value,allValues){var dl=typeof(value.data)!='undefined'?value.data.length:value.length; +return dl?'has-children':'no-children'}});}var store=this.store;if(i>0){store=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});}this.stores[i]=store;var view=this.views[i]=new Roo.View(il,this.tpl,{singleSelect:true,store:store,selectedClass:this.selectedClass} +);view.getEl().setWidth(lw);view.getEl().setStyle({position:i<1?'relative':'absolute',top:0,left:(i*lw)+'px',display:i>0?'none':'block'});view.on('selectionchange',this.onSelectChange,this,{list:i});view.on('dblclick',this.onDoubleClick,this,{list:i});store.on('beforeload',this.onBeforeLoad,this); +store.on('load',this.onLoad,this,{list:i});store.on('loadexception',this.onLoadException,this);},onResize:function(){},restrictHeight:function(){var mh=0;Roo.each(this.innerLists,function(il,i){var el=this.views[i].getEl();el.dom.style.height='';var inner=el.dom; +var h=Math.max(inner.clientHeight,inner.offsetHeight,inner.scrollHeight);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(view,sels,opts){var ix=view.getSelectedIndexes();if(opts.list>this.maxColumns-2){this.setFromData(ix.length?view.store.getAt(ix[0]).data:{});return;}if(!ix.length){this.setFromData({});var str=this.stores[opts.list+1];str.removeAll(); +return;}var rec=view.store.getAt(ix[0]);if(!this.isLoading){this.setFromData(rec.data);}var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);this.stores[opts.list+1].loadDataFromChildren(rec); +var dl=this.stores[opts.list+1].getTotalCount();this.views[opts.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[opts.list+1].getEl().setStyle({display:dl?'block':'none'});this.innerLists[opts.list+1].setHeight(this.innerLists[0].getHeight()); +this.list.setWidth(lw*(opts.list+(dl?2:1)));if(this.isLoading){this.selectActive(opts.list);}},onDoubleClick:function(){this.collapse();},recordToStores:function(store,prop,value,stack){var cstore=new Roo.data.SimpleStore({reader:this.store.reader,data:[]} +);var _this=this;var record=false;var srec=false;if(store.getCount()<1){return false;}store.each(function(r){if(r.data[prop]==value){record=r;return false;}if(r.data.cn&&r.data.cn.length){cstore.loadDataFromChildren(r);var cret=_this.recordToStores(cstore,prop,value,stack); +if(cret!==false){record=cret;srec=r;return false;}}return true;});if(record==false){return false}stack.unshift(srec);return record;},selectActive:function(){var stack=[];var rec=this.findRecordInStore(this.store,this.hiddenName,this.getValue());}); // 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