View Full Version : JSON Feed

24 Apr 2012, 9:06 AM
I'm new to Sencha and trying to use a JSON feed in a store like this:

proxy: {
type: 'jsonp',
url: 'http://facebook.tabletents.com/tabletents/app/getsitejson?id=186&callback=?',
reader: {
type: 'json',
rootProperty: 'data.Pages'

The itemTpl I'm using is just the TabName, a property inside the Pages section that I've set as the Root. I don't get any response though, so I'm wondering what the issue is. Any help is appreciated -

24 Apr 2012, 2:43 PM
I would review the Ext.data.proxy.JsonP (http://docs.sencha.com/touch/2-0/api/Ext.data.proxy.JsonP) in the Docs area again. Double check the callback wrapper is going around the JSON data (JSONP), make sure you associate the rootProperty to the correct node that you want to loop through for the data .. which yours is data.Pages, then your itemTpl should just show those items from the array
i.e. itemTpl: '<div>{TabName} -- Type: {PageType}</div>'

I think looking at the JSON, the wrapper is the main issue. The main item with JSONP is getting it wrapped with a dynamic callback name, so when the feed is called, the default should allow Sencha to create the callback based what is passed in the query param of your feed ?callback=_____

For example, if ?callback=JSONcallback, the returned JSON would be wrapped as:


If you leave the default, for example, Sencha dynamicaly created the wrapper based on the callback query param:


Hope that helps