Roo/form/ComboNested.js
[roojs1] / Roo / form / ComboNested.js
index 05b2d25..4b67933 100644 (file)
@@ -293,13 +293,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 );
@@ -310,10 +311,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(); //??
@@ -324,7 +329,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
     
     
     // private
-    recordToStores : function(store, prop, value, stack)
+    recordToStack : function(store, prop, value, stack)
     {
         var cstore = new Roo.data.SimpleStore({
             //fields : this.store.reader.meta.fields, // we need array reader.. for
@@ -345,7 +350,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
             }
             if (r.data.cn && r.data.cn.length) {
                 cstore.loadDataFromChildren( r);
-                var cret = _this.recordToStores(cstore, prop, value, stack);
+                var cret = _this.recordToStack(cstore, prop, value, stack);
                 if (cret !== false) {
                     record = cret;
                    srec = r;
@@ -372,8 +377,10 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
     {
        // 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);
-       
+       this.recordToStack(this.store, this.valueField, this.getValue(), stack);
+       for (var i = 0; i < stack.length; i++ ) {
+           this.view[i].select(stack[i].store.indexOf(stack[i]), false, false );
+       }
        
     }