View Full Version : Data Store Load Issue

19 Aug 2011, 9:02 AM
I have the following problem, when I populate my Store via AJAX call to the page that returns JSON, it gets populated with empty records. For example in Firebug for Ext.util.MixedCollection I see 108 records; all empty. Should be just one. Code example:

Ext.regModel('Stuff', {
fields: ['sfirstName', 'slastName', 'playNumber', 'sEmail', 'sPhone']

Stuff = new Ext.data.Store({
model: 'Stuff',
proxy: {
type: 'ajax',
url: '/Stuff',
type: 'json',
root: 'records'

JSON response: {"records":"[{\"sfirstName1\":\"John\",\"slastName1\":\"UserName1\",\"sEmail1\":\"FirstName1@test.com\",\"sPhone1\":\"(248) 232 2322\"}]"}

Any ideas? THX!

19 Aug 2011, 1:35 PM
Looks like the server is escaping the quotes in the JSON when it shouldn't.

Paste that JSON into http://jsonviewer.stack.hu/ and then go to the viewer tab to see the structure issue.