roojs-ui.js
authorAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 07:07:54 +0000 (15:07 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 07:07:54 +0000 (15:07 +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 db50667..cc9114e 100644 (file)
@@ -342,20 +342,20 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
             return false;
         }
         store.each(function(r){
-             if(r.data[prop] == value){
-                 record = r;
-                 return false;
-             }
-             if (r.data.cn && r.data.cn.length) {
+            if(r.data[prop] == value){
+                record = r;
+                return false;
+            }
+            if (r.data.cn && r.data.cn.length) {
                 cstore.loadDataFromChildren( r);
                 var cret = _this.findRecordInStore(cstore, prop, value);
                 if (cret !== false) {
                     record = cret;
                     return false;
                 }
-             }
+            }
              
-             return true;
+            return true;
         });
         
         return record;
index e1ecfbd..4f954e1 100644 (file)
@@ -1774,8 +1774,10 @@ this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.
 }},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()>0){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;},function selectActive()});
+}},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=this.getValue();var C=this.hiddenName;
+var D=this.stores[A];if(D.getCount()<1){return;}D.each(function(r){if(r.data[C]==B){record=r;return false;}if(r.data.cn&&r.data.cn.length){cstore.loadDataFromChildren(r);var E=_this.findRecordInStore(cstore,C,B);if(E!==false){record=E;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);
index d32eded..2336d5b 100644 (file)
@@ -43042,28 +43042,58 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         });
         var _this = this;
         var record  = false;
-        if(store.getCount() > 0){
-           store.each(function(r){
-                if(r.data[prop] == value){
-                    record = r;
+        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.findRecordInStore(cstore, prop, value);
+                if (cret !== false) {
+                    record = cret;
                     return false;
                 }
-                if (r.data.cn && r.data.cn.length) {
-                    cstore.loadDataFromChildren( r);
-                    var cret = _this.findRecordInStore(cstore, prop, value);
-                    if (cret !== false) {
-                        record = cret;
-                        return false;
-                    }
-                }
-                
-                return true;
-            });
-        }
+            }
+             
+            return true;
+        });
+        
         return record;
     },
     
-    function selectActive()
+    
+    
+    selectActive : function (lvl)
+    {
+        // 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){
+            if(r.data[prop] == value){
+                 record = r;
+                 return false;
+            }
+             if (r.data.cn && r.data.cn.length) {
+                 cstore.loadDataFromChildren( r);
+                 var cret = _this.findRecordInStore(cstore, prop, value);
+                 if (cret !== false) {
+                     record = cret;
+                     return false;
+                 }
+             }
+             
+             return true;
+        });
+        
+    }
     
     
     
index abb0bf8..1356457 100644 (file)
@@ -20558,28 +20558,58 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         });
         var _this = this;
         var record  = false;
-        if(store.getCount() > 0){
-           store.each(function(r){
-                if(r.data[prop] == value){
-                    record = r;
+        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.findRecordInStore(cstore, prop, value);
+                if (cret !== false) {
+                    record = cret;
                     return false;
                 }
-                if (r.data.cn && r.data.cn.length) {
-                    cstore.loadDataFromChildren( r);
-                    var cret = _this.findRecordInStore(cstore, prop, value);
-                    if (cret !== false) {
-                        record = cret;
-                        return false;
-                    }
-                }
-                
-                return true;
-            });
-        }
+            }
+             
+            return true;
+        });
+        
         return record;
     },
     
-    function selectActive()
+    
+    
+    selectActive : function (lvl)
+    {
+        // 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){
+            if(r.data[prop] == value){
+                 record = r;
+                 return false;
+            }
+             if (r.data.cn && r.data.cn.length) {
+                 cstore.loadDataFromChildren( r);
+                 var cret = _this.findRecordInStore(cstore, prop, value);
+                 if (cret !== false) {
+                     record = cret;
+                     return false;
+                 }
+             }
+             
+             return true;
+        });
+        
+    }
     
     
     
index b51448b..7f3a122 100644 (file)
@@ -904,8 +904,10 @@ this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.
 }},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()>0){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;},function selectActive()});
+}},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=this.getValue();var C=this.hiddenName;
+var D=this.stores[A];if(D.getCount()<1){return;}D.each(function(r){if(r.data[C]==B){record=r;return false;}if(r.data.cn&&r.data.cn.length){cstore.loadDataFromChildren(r);var E=_this.findRecordInStore(cstore,C,B);if(E!==false){record=E;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);