roojs-ui.js
[roojs1] / roojs-ui-debug.js
index 848de63..d10424f 100644 (file)
@@ -20513,13 +20513,14 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         }
         
         var rec = view.store.getAt(ix[0]);
-        if (!this.isLoading) {
-            this.setFromData(rec.data);
-        }
+         
+        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.listWidth * this.maxColumns || Math.max(this.wrap.getWidth(), this.minListWidth)) - this.list.getFrameWidth('lr')
+           ) / this.maxColumns
         );
         
         this.stores[opts.list+1].loadDataFromChildren( rec );
@@ -20530,10 +20531,14 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         this.list.setWidth(lw * (opts.list + (dl ? 2 : 1)));
         
         if (this.isLoading) {
-            this.selectActive(opts.list);
+           // this.selectActive(opts.list);
         }
          
     },
+    
+    
+    
+    
     onDoubleClick : function()
     {
         this.collapse(); //??
@@ -20560,6 +20565,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         store.each(function(r){
             if(r.data[prop] == value){
                 record = r;
+               srec = r;
                 return false;
             }
             if (r.data.cn && r.data.cn.length) {
@@ -20589,11 +20595,14 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
     
     selectActive : function ()
     {
-        
-       var stack = [];
-       var rec =  this.findRecordInStore(this.store, this.hiddenName, this.getValue());
-       
+       // if store is not loaded, then we will need to wait for that to happen first.
+        var stack = [];
+       this.findRecordInStore(this.store, this.hiddenName, this.getValue(), stack);
+       for (var i = 0; i < stack.length; i++ ) {
+           this.view[i].select(stack[i].store.indexOf(stack[i]), false, false );
+       }
        
+    }