{
Roo.data.SimpleStore.superclass.constructor.call(this, {
isLocal : true,
- reader: typeof(config.reader) != 'undefined' ? config.reader : new Roo.data.ArrayReader({
- id: config.id
+ reader: new Roo.data.ArrayReader({
+ id: config.id,
+ fields : config.fields
},
Roo.data.Record.create(config.fields)
),
return new this.recordType(Roo.apply(da, d));
}
+
};/*
* Based on:
* Ext JS Library 1.1.1
*
* created using {@link Roo.data.Record#create}.
*/
-Roo.data.ArrayReader = function(meta, recordType){
-
-
+Roo.data.ArrayReader = function(meta, recordType)
+{
Roo.data.ArrayReader.superclass.constructor.call(this, meta, recordType||meta.fields);
};
var store = this.store;
if (i > 0) {
store = new Roo.data.SimpleStore({
- reader : this.store.reader,
+ fields : this.store.reader.meta.fields,
data : [ ]
});
}
//view.on('click', this.onViewClick, this, { list : i });
store.on('beforeload', this.onBeforeLoad, this);
- store.on('load', this.onStoreLoad, this, { list : i});
+ store.on('load', this.onLoad, this, { list : i});
store.on('loadexception', this.onLoadException, this);
// hide the other vies..
//this.el.focus();
},
- onStoreLoad : function ()
- {
- Roo.log(arguments);
- },
+
// private
onLoadException : function()
var lw = Math.floor(
((this.listWidth * 3 || Math.max(this.wrap.getWidth(), this.minListWidth)) - this.list.getFrameWidth('lr')) / 3
);
-
- this.stores[opts.list+1].loadData( typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn);
+ var data = typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn;
+ this.stores[opts.list+1].loadData( data );
this.views[opts.list+1].getEl().setHeight( this.innerLists[0].getHeight());
- this.views[opts.list+1].getEl().setStyle({ display : rec.data.cn.length ? 'block' : 'none' });
+ this.views[opts.list+1].getEl().setStyle({ display : data .length ? 'block' : 'none' });
this.innerLists[opts.list+1].setHeight( this.innerLists[0].getHeight());
- this.list.setWidth(lw * (opts.list + (rec.data.cn.length ? 2 : 1)));
+ this.list.setWidth(lw * (opts.list + (data.length ? 2 : 1)));
},
onDoubleClick : function()
{
findRecordInStore : function(store, prop, value)
{
var cstore = new Roo.data.SimpleStore({
- reader : this.store.reader, // we need array reader.. for
+ fields : this.store.reader.meta.fields, // we need array reader.. for
data : [ ]
});
var _this = this;
return record;
}
+
+
+
});/*
* Based on:
* Ext JS Library 1.1.1