Roo/form/ComboNested.js
[roojs1] / Roo / form / ComboNested.js
index 4c5afb2..07dcb31 100644 (file)
@@ -281,7 +281,6 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         var ix = view.getSelectedIndexes();
          
         if (opts.list > this.maxColumns - 2) {
-             
             this.setFromData(ix.length ? view.store.getAt(ix[0]).data : {});
             return;
         }
@@ -313,8 +312,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         if (this.isLoading) {
             this.selectActive(opts.list);
         }
-        
-        
+         
     },
     onDoubleClick : function()
     {
@@ -377,29 +375,27 @@ 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;
+                var ix = store.getIndexOf(r);
+                this.views[lvl].select(ix, false, true);
                 return false;
             }
             
             if (r.data.cn && r.data.cn.length) {
-                cstore.loadDataFromChildren( r);
+                cstore.loadDataFromChildren(r);
                 var cret = _this.findRecordInStore(cstore, prop, value);
                 if (cret !== false) {
-                    record = r;
+                    var ix = store.getIndexOf(r);
+                    this.views[lvl].select(ix, false, false); // will trigger select change..
                     return false;
                 }
             }
              
             return true;
         });
-        if (record !== false) {
-            var ix = store.getIndexOf(record);
-            this.views[lvl].function(ix, false, true); // will not trigger select change..
-        }
         
     }