PDA

View Full Version : TypeError: reader.read is not a function



webfriend13
12 Aug 2012, 5:15 AM
HI All,

I haver a store which looks like this:




Ext.define('MyStore', {
extend: 'Ext.data.ArrayStore',
model: 'MyModel',
requires: ['MyModel'],
autoLoad: false,
proxy: { type: 'ajax',
timeout: 180000,
url: '/muUrl',
reader: {
type: 'json'
}
}

});


The store has a model which looks like this:



Ext.define('MyModel', {
extend: 'Ext.data.Model',
//idProperty: 'id',
fields: [
{ name: 'One', defaultValue: "No data found" },
{ name: 'Two' },
{ name: 'DimensionName' }
],
requires: ['Ext.data.HasManyAssociation', 'Ext.data.BelongsToAssociation']
});




When i say MyStore.Load, I get following error: TypeError: reader.read is not a function
What is the reason for this error. Please provide fix.

mankz
12 Aug 2012, 6:49 AM
You are extending ArrayStore and giving it a json reader? Doesn't make sense, try extending just Store.

webfriend13
12 Aug 2012, 8:35 PM
Hi Mankz,

Thank you for quick reply. I tired but its not working that way either :(

scottmartin
13 Aug 2012, 10:57 AM
See if this helps:
http://www.sencha.com/forum/showthread.php?136484

Scott.