My datastore works when I have a configuration member of ‘data: …raw json’ inside the data store but when I try to load it via ajax it doesn’t work.
new Ext.data.Store({
model: "SearchResult",
proxy: {
type: "ajax",
url : "test.php",
extraParams : 'test',
reader: {
type: "json",
}
},
});
Note: test.php gets called according to chrome and echoes out:
{stock: 'Tommy', storePhone: '353535', year: '1984', make: 'Ferrari', trim: 'trim', miles: '12345', storename: 'branch name' },{stock: 'Tommy', storePhone: '353535', year: '1984', make: 'Ferrari', trim: 'trim', miles: '12345', storename: 'branch name' },{stock: 'Tommy', storePhone: '353535', year: '1984', make: 'Ferrari', trim: 'trim', miles: '12345', storename: 'branch name' }
Any ideas what I am doing wrong?
do you encode your data as json in php ?
like this echo json_encode($data);
It’s either that or the model is completely different from the response.
A json format would look like this