I have this JSON:
{
"aaa": {
"list": {
"count":"1",
"data": [
{"id":"1","username":"user1","email":"user1@test.com"}
]
}
}
}
And this is my Store:
var store = Ext.create('Ext.data.Store', {
fields : [ 'id',
'username',
'email'],
autoLoad : true,
proxy: {
type: 'ajax',
api: {
read: 'server/users'
},
reader: {
type: 'json',
successProperty: 'success',
root: 'data',
messageProperty: 'message'
}
}
});
And this is my Grid:
xtype: 'grid',
title: 'Users',
id: 'users',
store: store,
columns: {
items: [
{text: 'ID', dataIndex: 'id', editor: 'textfield'},
{text: 'Name', dataIndex: 'name', editor: 'textfield' },
{text: 'Email', dataIndex: 'email', editor: 'textfield' },
]
},
But this code is not working. I don't show JSON data on my grid. I think the problem is that I don't reach JSON elements.
How can I reach this elements? (aaa.data.id, aaa.data.name, aaa.data.email is not working)