roojs-ui.js
authorAlan Knowles <alan@roojs.com>
Fri, 7 Feb 2020 07:50:36 +0000 (15:50 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 7 Feb 2020 07:50:36 +0000 (15:50 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js
Roo/form/ComboNested.js

Roo/form/ComboNested.js
roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index a541600..7d25c99 100644 (file)
@@ -227,7 +227,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         if(!this.hasFocus){
             return;
         }
-        this.innerList[0].update(this.loadingText ?
+        this.innerLists[0].update(this.loadingText ?
                '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
         this.restrictHeight();
         this.selectedIndex = -1;
index 2031dba..0db8262 100644 (file)
@@ -1768,8 +1768,9 @@ il.setStyle({'overflow-x':'hidden'});if(!this.tpl){this.tpl=new Roo.Template({ht
 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.onStoreLoad,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.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();},onLoad:function(a,b,c,d){if(!this.hasFocus){return;
-}if(this.store.getCount()>0){this.expand();this.restrictHeight();}else{this.onEmptyResults();}},onStoreLoad:function(){Roo.log(arguments);},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);
+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();}},onStoreLoad:function(){Roo.log(arguments);},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>1){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*3||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/3);this.stores[C.list+1].loadData(typeof(D.data.cn)=='undefined'?[]:D.data.cn);this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());
 this.views[C.list+1].getEl().setStyle({display:D.data.cn.length?'block':'none'});this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight());this.list.setWidth(lw*(C.list+(D.data.cn.length?2:1)));},onDoubleClick:function(){this.collapse();},findRecord:function(A,B){return this.findRecordInStore(this.store,A,B);
index cda4882..f2c1d83 100644 (file)
@@ -42889,7 +42889,17 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
      
     
     // -- store handlers..
-    
+    // private
+    onBeforeLoad : function()
+    {
+        if(!this.hasFocus){
+            return;
+        }
+        this.innerLists[0].update(this.loadingText ?
+               '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
+        this.restrictHeight();
+        this.selectedIndex = -1;
+    },
     // private
     onLoad : function(a,b,c,d)
     {
index 6e8802e..4db054c 100644 (file)
@@ -20405,7 +20405,17 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
      
     
     // -- store handlers..
-    
+    // private
+    onBeforeLoad : function()
+    {
+        if(!this.hasFocus){
+            return;
+        }
+        this.innerLists[0].update(this.loadingText ?
+               '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
+        this.restrictHeight();
+        this.selectedIndex = -1;
+    },
     // private
     onLoad : function(a,b,c,d)
     {
index 0867b7b..ae99246 100644 (file)
@@ -898,8 +898,9 @@ il.setStyle({'overflow-x':'hidden'});if(!this.tpl){this.tpl=new Roo.Template({ht
 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.onStoreLoad,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.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();},onLoad:function(a,b,c,d){if(!this.hasFocus){return;
-}if(this.store.getCount()>0){this.expand();this.restrictHeight();}else{this.onEmptyResults();}},onStoreLoad:function(){Roo.log(arguments);},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);
+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();}},onStoreLoad:function(){Roo.log(arguments);},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>1){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*3||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/3);this.stores[C.list+1].loadData(typeof(D.data.cn)=='undefined'?[]:D.data.cn);this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());
 this.views[C.list+1].getEl().setStyle({display:D.data.cn.length?'block':'none'});this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight());this.list.setWidth(lw*(C.list+(D.data.cn.length?2:1)));},onDoubleClick:function(){this.collapse();},findRecord:function(A,B){return this.findRecordInStore(this.store,A,B);