roojs-ui.js
authorAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 07:12:57 +0000 (15:12 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 07:12:57 +0000 (15:12 +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 4f954e1..634eded 100644 (file)
@@ -1775,9 +1775,9 @@ this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.
 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=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;
-});}});
+}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;}var F=false;E.each(function(r){if(r.data[D]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){B.loadDataFromChildren(r);var G=_this.findRecordInStore(B,D,C);
+if(G!==false){F=r;return false;}}return true;});if(F!==false){var ix=E.getIndexOf(F);this.views[A].function(ix,false,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 2336d5b..0aa8f5a 100644 (file)
@@ -43069,6 +43069,11 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
     
     selectActive : function (lvl)
     {
+        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;
@@ -43076,22 +43081,29 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         if(store.getCount() < 1){
             return;
         }
+        var record = false;
         store.each(function(r){
+            // selected is at this level
             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;
-                 }
-             }
+                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 = r;
+                    return false;
+                }
+            }
              
-             return true;
+            return true;
         });
+        if (record !== false) {
+            var ix = store.getIndexOf(record);
+            this.views[lvl].function(ix, false, true); // will not trigger select change..
+        }
         
     }
     
index 1356457..c7f1e2d 100644 (file)
@@ -20585,6 +20585,11 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
     
     selectActive : function (lvl)
     {
+        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;
@@ -20592,22 +20597,29 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         if(store.getCount() < 1){
             return;
         }
+        var record = false;
         store.each(function(r){
+            // selected is at this level
             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;
-                 }
-             }
+                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 = r;
+                    return false;
+                }
+            }
              
-             return true;
+            return true;
         });
+        if (record !== false) {
+            var ix = store.getIndexOf(record);
+            this.views[lvl].function(ix, false, true); // will not trigger select change..
+        }
         
     }
     
index 7f3a122..459485f 100644 (file)
@@ -905,9 +905,9 @@ this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.
 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=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;
-});}});
+}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;}var F=false;E.each(function(r){if(r.data[D]==C){F=r;return false;}if(r.data.cn&&r.data.cn.length){B.loadDataFromChildren(r);var G=_this.findRecordInStore(B,D,C);
+if(G!==false){F=r;return false;}}return true;});if(F!==false){var ix=E.getIndexOf(F);this.views[A].function(ix,false,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);