var ix = view.getSelectedIndexes();
if (opts.list > this.maxColumns - 2) {
-
this.setFromData(ix.length ? view.store.getAt(ix[0]).data : {});
return;
}
if (this.isLoading) {
this.selectActive(opts.list);
}
-
-
+
},
onDoubleClick : function()
{
});
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)
+ {
+ 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;
+ }
+ var record = false;
+ store.each(function(r){
+ // selected is at this level
+ 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) {
+ var ix = store.getIndexOf(r);
+ this.views[lvl].select(ix, false, false); // will trigger select change..
+ return false;
+ }
+ }
+
+ return true;
+ });
+
+ }