Override ArrayReader's readRecords() method to convert data from server
Hi
ExtJS 3.4.0
I need to convert data to a different format and I'm attempting to do this by overriding the readRecords() method.
So far this code gives an error after the 'readRecords:' console message.
Any help or suggestions or links to samples would be appreciated.
Code:
readRecords:
TypeError: b is undefined
Code:
var MyFields = Ext.data.Record.create([
{name: 'id'},
{name: 'name'}
]);
MyReader = Ext.extend(Ext.data.ArrayReader, {
fields: MyFields,
readRecords: function(o) {
console.log('readRecords:');
MyReader.superclass.readRecords.apply(this, o);
}
});
MyStore = Ext.extend(Ext.data.ArrayStore, {
reader: new MyReader()
});