I have time trying to load external json into Sencha Touch app. I can determine my data in the application or using an external json file and everything is fine. Then I transfer my json file to a remote server, change my proxy to type: "scripttag" to take care of jsonp problems, and then I have problems. When I look at the resources of my page, I see that the json DID file is loading, but it does not populate my list, as happens with my local json file.
Using local json file (this works)
var jsonStore = new Ext.data.Store({ model: "Person", proxy: { type: 'ajax', url: 'http://dev.liftstudios.ca/data.json', reader: { type: 'json' } }, autoLoad: true }); var jsonPanel = { title: "json", items: [ { xtype: 'list', store: jsonStore, itemTpl:itemTemplate, singleSelect: true } ] };
Using the same json file downloaded from a remote host.
Loads a file but does not populate the list.
var jsonStore = new Ext.data.Store({ model: "Person", proxy: { type: 'scripttag', url: 'http://www.server.com/data.json', reader: { type: 'json' } }, autoLoad: true }); var jsonPanel = { title: "json", items: [ { xtype: 'list', store: jsonStore, itemTpl:itemTemplate, singleSelect: true } ] };
Something is probably embarrassing just what I am missing here, but I'm not sure what it is. Any help would be appreciated.
source share