Say that I have a the fields here for a user in a "json" format:
{
"users": [
{
"id": 1,
"name": "Ed Spencer",
"email": "[email protected]"
},
{
"id": 2,
"name": "Abe Elias",
"email": "[email protected]"
}
]
}
I assume that the root here is "users". Would I save this text as a users.json file?
And from there, how do I read from this file (in this case, with ext.js)
Ext.define('AM.model.User', {
extend: 'Ext.data.Model',
fields: ['name', 'email']
});
var store = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url : 'users.json',
reader: {
type: 'json',
root: 'users'
}
}
});
What is the url? Is it an absolute path? Will this even work??? Help!