Roo/form/ComboNested.js
authorAlan Knowles <alan@roojs.com>
Fri, 7 Feb 2020 06:49:17 +0000 (14:49 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 7 Feb 2020 06:49:17 +0000 (14:49 +0800)
Roo/form/ComboNested.js

index 7c4295e..91f1710 100644 (file)
@@ -316,20 +316,33 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
         this.value = v;
     },
     
+    findRecord : funciton (prop,value)
+    {
+        return this.findRecordInStore(this.store, prop,value);
+    },
     
      // private
-    findRecord : function(store, prop, value)
+    findRecordInStore : function(store, prop, value)
     {
+        var cstore = new Roo.data.SimpleStore({
+            reader : this.store.reader,
+            data : [ ]
+        });
         
-        
-        var record;
-        if(this.store.getCount() > 0){
-            this.store.each(function(r){
+        var record  = false;
+        if(store.getCount() > 0){
+           store.each(function(r){
                 if(r.data[prop] == value){
                     record = r;
                     return false;
                 }
-                
+                if (r.data.cn && r.data.cn.length) {
+                    var cret = cstore.loadData( r.data.cn);
+                    if (cret !== false) {
+                        record = cret;
+                        return false;
+                    }
+                }
                 
                 return true;
             });