After loading JSON data into the store, I am unable to see any data in the grid. Can someone please point out what I might be doing wrong? Here's the code snippet for the grid:
{
xtype: 'gridpanel',
title: 'Clients List',
store: Ext.create('Ext.data.Store', {
model: 'app.model.modelClients',
proxy: Ext.create('Ext.data.HttpProxy', {
type: 'ajax',
headers: { 'Accept': 'application/json' },
url: 'client.php',
noCache: false,
startParam: undefined,
filterParam: undefined,
limitParam: undefined,
pageParam: undefined
}),
reader: new Ext.data.JsonReader({
root: 'records',
id: 'id',
fields: ['first_name', 'last_name', 'phone']
}),
listeners: {
load: function (self, records, successful, eOpts) {
var fields = records[0].fields;
console.log(fields.getAt(0));
}
},
autoLoad: true
}),
flex: '1',
columns: [
{ text: 'Name', dataIndex: 'first_name' },
{ text: 'Last Name', dataIndex: 'last_name' },
{ text: 'Phone', dataIndex: 'phone' }
]
}