Forum /
Sencha Touch 1.x Forums /
Sencha Touch 1.x: Q&A /
Unanswered: Data Store Load Issue
Unanswered: Data Store Load Issue
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',
reader:
{
type: 'json',
root: 'records'
}
}
});
JSON response: {"records":"[{\"sfirstName1\":\"John\",\"slastName1\":\"UserName1\",\"sEmail1\":\"FirstName1@test.com\",\"sPhone1\":\"(248) 232 2322\"}]"}
Any ideas? THX!
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.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us