roojs-ui.js
authorAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 06:37:15 +0000 (14:37 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 06:37:15 +0000 (14:37 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 682de42..b6786de 100644 (file)
@@ -1771,11 +1771,11 @@ B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException
 if(i<1){el.setHeight(h<this.maxHeight?'auto':this.maxHeight);il.setHeight(h<this.maxHeight?'auto':this.maxHeight);mh=Math.max(el.getHeight(),mh);}},this);this.list.beginUpdate();this.list.setHeight(mh+this.list.getFrameWidth('tb')+this.assetHeight);this.list.alignTo(this.el,this.listAlign);
 this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.innerLists[0].update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+'</div>':'');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({});this.stores[C.list+1].loadData([]);return;}var D=A.store.getAt(ix[0]);
-this.setFromData(D.data);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);var E=typeof(D.data.cn)=='undefined'?[]:D.data.cn;var dl=typeof(E.data)!='undefined'?E.total:E.length;
-this.stores[C.list+1].loadData(E);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.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;}});
 // 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);
index d9e56da..f270701 100644 (file)
@@ -42969,7 +42969,8 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         
         if (!ix.length) {
             this.setFromData({});
-            this.stores[opts.list+1].loadData( [] );
+            var str = this.stores[opts.list+1];
+            str.loadData( str.reader.readerType == 'json' ? { data : [] } : [] );
             return;
         }
         
index e46e20a..6e92abc 100644 (file)
@@ -20485,7 +20485,8 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         
         if (!ix.length) {
             this.setFromData({});
-            this.stores[opts.list+1].loadData( [] );
+            var str = this.stores[opts.list+1];
+            str.loadData( str.reader.readerType == 'json' ? { data : [] } : [] );
             return;
         }
         
index a636406..ddee866 100644 (file)
@@ -901,11 +901,11 @@ B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException
 if(i<1){el.setHeight(h<this.maxHeight?'auto':this.maxHeight);il.setHeight(h<this.maxHeight?'auto':this.maxHeight);mh=Math.max(el.getHeight(),mh);}},this);this.list.beginUpdate();this.list.setHeight(mh+this.list.getFrameWidth('tb')+this.assetHeight);this.list.alignTo(this.el,this.listAlign);
 this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.innerLists[0].update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+'</div>':'');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({});this.stores[C.list+1].loadData([]);return;}var D=A.store.getAt(ix[0]);
-this.setFromData(D.data);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);var E=typeof(D.data.cn)=='undefined'?[]:D.data.cn;var dl=typeof(E.data)!='undefined'?E.total:E.length;
-this.stores[C.list+1].loadData(E);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.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;}});
 // 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);