X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=cb92a61bfa90c684dc08658b6a17417c1e66e7da;hb=b8b7e1e8733ce3d36d7e29ecb1b5f182b14e209c;hp=1680bd0a69763f5f6e9e6417d73f24807e56ae88;hpb=e5d58c7fb19a52fd492274dcf4fec736d6d632c6;p=roojs1 diff --git a/roojs-debug.js b/roojs-debug.js index 1680bd0a69..cb92a61bfa 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -43025,13 +43025,10 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { - findRecord : function (prop,value) - { - return this.findRecordInStore(this.store, prop,value); - }, + // private - findRecordInStore : function(store, prop, value) + recordToStores : function(store, prop, value, stack) { var cstore = new Roo.data.SimpleStore({ //fields : this.store.reader.meta.fields, // we need array reader.. for @@ -43040,6 +43037,7 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { }); var _this = this; var record = false; + var srec = false; if(store.getCount() < 1){ return false; } @@ -43050,58 +43048,38 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, { } if (r.data.cn && r.data.cn.length) { cstore.loadDataFromChildren( r); - var cret = _this.findRecordInStore(cstore, prop, value); + var cret = _this.recordToStores(cstore, prop, value, stack); if (cret !== false) { record = cret; + srec = r; return false; } } return true; }); - + if (record == false) { + return false + } + stack.unshift(srec); return record; }, + /* + * find the stack of stores that match our value. + * + * + */ - - selectActive : function (lvl) + selectActive : function () { - var cstore = new Roo.data.SimpleStore({ - //fields : this.store.reader.meta.fields, // we need array reader.. for - reader : this.store.reader, - data : [ ] - }); - // 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){ - // selected is at this level - if(r.data[prop] == value){ - 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); - var cret = _this.findRecordInStore(cstore, prop, value); - if (cret !== false) { - var ix = store.getIndexOf(r); - this.views[lvl].select(ix, false, false); // will trigger select change.. - return false; - } - } - - return true; - }); - - } + var stack = []; + var rec = this.findRecordInStore(this.store, this.hiddenName, this.getValue()); + + + +