X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FComboNested.js;h=db506672d6cb4dcd7b86ebef1f941b551bc2071a;hb=bb6882939bbac891bdd83fabf1a49d05f99f127c;hp=6549e8ef9d781b916546994e555ffa089c3a6531;hpb=fbccee01a4b2d22f26b77caa256f18d8cff48524;p=roojs1 diff --git a/Roo/form/ComboNested.js b/Roo/form/ComboNested.js index 6549e8ef9d..db506672d6 100644 --- a/Roo/form/ComboNested.js +++ b/Roo/form/ComboNested.js @@ -338,28 +338,58 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { }); var _this = this; var record = false; - if(store.getCount() > 0){ - store.each(function(r){ - if(r.data[prop] == value){ - record = r; + if(store.getCount() < 1){ + return false; + } + store.each(function(r){ + 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; } - 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; - } - } - - return true; - }); - } + } + + return true; + }); + return record; }, - function selectActive() + + + selectActive : function (lvl) + { + // just need to determine which of the current level is selected if any.. + var value = this.getValue(); + var prop = this.hiddenName; + var store = this.stores[lvl]; + if(store.getCount() < 1){ + return; + } + store.each(function(r){ + 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; + } + } + + return true; + }); + + }