PDA

View Full Version : TypeError: 'null' is not an object (evaluating 'reader.getReaderType')



rgralhoz
18 Dec 2012, 4:32 PM
Sencha Architect
Version: 2.1.0 Build 676
Windows 7

Steps to reproduce the error:
Create model, store and proxy* as defined bellow, through architect
Project Inspector > RMB on Users store > Load data
Project Inspector > LMB on Users store 'view response' icon
* I haven't create a reader for my JSON response yet; I changed header values and url for this post


Ext.define('MyApp.store.Users', {
extend: 'Ext.data.Store',


requires: [
'MyApp.model.User'
],


constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
storeId: 'Users',
model: 'MyApp.model.User',
clearOnPageLoad: false,
clearRemovedOnLoad: false,
proxy: {
type: 'rest',
url: 'example.com/users',
headers: {
Accept: 'application/json;version=1',
Authorization: 'basic xpto'
}
}
}, cfg)]);
}
});


Ext.define('MyApp.model.User', {
extend: 'Ext.data.Model',


idProperty: 'key',


fields: [
{
name: 'name'
},
{
name: 'key',
type: 'int'
},
{
name: 'firstName'
},
{
name: 'lastName'
}
]
});