PDA

View Full Version : JSONP loading problem



sapkalparag
7 May 2012, 2:33 AM
Hi

I am trying to populate a simple list witha data from a json. Each entry contain only 3 fields.

i set up my json store , proxy and also the reader as given on the architect docs page...
http://docs.sencha.com/architect/2-0/#!/guide/stores_examples

i have put my userData.json in the folder as.....

/NavigationExample/app/data/userData.json

where NavigationExample is my project.
the URL prefix is set in settings as http://localhost:8080/Projects/NavigationExample

while in JSONProxy I have set url as - http://localhost:8080/Projects/NavigationExample/app/data/userData.json
when i load the store..it gives an error saying

Unable to load data using the supplied configuration.
Open in Browser: http://localhost:8080/Projects/NavigationExample/app/data/userData.json

when click on the link the json file perfectly opens in the browser.
Where am i going wrong?
Thanks in advance

aconran
7 May 2012, 3:39 AM
Are you using JSON-P? Have you wrapped your json data in a callback? It looks like you are using static json data and should be using a json proxy.

sapkalparag
7 May 2012, 9:43 PM
Hi aconran

Thanks alot for ur help. I got myself educated because of your reply. N i could load my json data in the project. Thanks alot.

Going to try the same with XML data soon. Might have to come back as i m still a newbie. ;)
Thanks again for your help.

dboy221
28 Sep 2012, 11:56 AM
I am having the same issue. I have a wcf (.net) service that is called and is resolved and returns the json formatted data. Aconran can you explain more about the callback. I'm using JSONP as the proxy type and for the reader I have provided json as the type.

aconran
28 Sep 2012, 1:13 PM
I am having the same issue. I have a wcf (.net) service that is called and is resolved and returns the json formatted data. Aconran can you explain more about the callback. I'm using JSONP as the proxy type and for the reader I have provided json as the type.

JSONP is typically used in environments where you must load data from a different domain. If you are trying to load data from the same domain, you really should be just using a simple AjaxProxy and JSONReader.

The callback is the function that wraps around the data. Take a look at this details description on wikipedia:
http://en.wikipedia.org/wiki/JSONP

dboy221
28 Sep 2012, 9:14 PM
Thanks for the wiki reference. That really helped as I was able to load the data in the store using "Load Data" However, when I preview my app live in the browser it does not show the data being pulled in.

aconran
1 Oct 2012, 10:19 AM
Did you set the autoLoad configuration on Store or programatically invoke the load method on it?

dboy221
1 Oct 2012, 6:38 PM
Did you set the autoLoad configuration on Store or programatically invoke the load method on it?

Actually, I was able to find out that my wcf service needs to be configured to support JSONP. Working on doing this now.

Zaina.Alyahya
17 Jan 2013, 4:01 AM
Did you set the autoLoad configuration on Store or programatically invoke the load method on it?

I'm facing the same problem: getting the same message when I try to load data from store, although the link works perfectly on browser and retrieves all available data.
how should the autoLoad be configured on Store?

avrmraja
1 Mar 2013, 6:25 AM
Hii... managed to display data using a webservice url in list with


navigation view in the designer part of sencha architect2 but when it


runs in browser it displays empty then upon some reference for cross


domain heard JSONP should be used.. But not able to even load data to


store using jsonp.. It displays error "unable to load data with


specified configuration".. I loaded model using rest proxy, even i


changed it to jsonp and ajax but result is same..is ter any changes to


be made..
Thanks in advance!!!

mahender
13 Mar 2013, 12:53 AM
hi...

I'm facing the same problem: getting the same message when I try to load data from store in sencha architect, although the link works perfectly on browser and retrieves all available data.

But when i load data it giving error "unable to load data with
specified configuration".


how to resolve this problem?