I am a beginner at ExtJS, and was studying the tutorials on sencha, and one just doesn't want to work (app tutorial).
I have a simple store for a grid, and when the store is using an AJAX proxy to read a json file, the data doesn't show, and according to the net tab in firebug nothing was loaded, because it is empty. And no error is thrown what so ever. But if I add a bad url for my json file, then it throws an error that it can't be found.
my store looks like this:
Ext.define('AM.store.Users', {
extend: 'Ext.data.Store',
model: 'AM.model.User',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'data/users.json',
reader: {
type: 'json',
root: 'users',
successProperty: 'success'
}
}
});
my json file like this:
{
"success": true,
"users": [
{"name": "Ed", "email": "[email protected]"},
{"name": "Tommy", "email": "[email protected]"}
]
}
model:
Ext.define('AM.model.User', {
extend: 'Ext.data.Model',
fields: ['name', 'email']
});
these are exactly the same as in the downloadable source file of the tutorial, which also don't work. If data is defined inline the store, everything is ok. Please help, completely blocked here.
Thanks!
ext-all-dev.js
orext-dev.js
so you have more logging. Open up your console. What does it say? You should require your model too ;) just add an extra paramrequires: ['AM.model.User']
. Like @Eric sais are you running from a webserver? – VDP