PDA

View Full Version : Trouble Loading Json to List



heloWelo
24 Aug 2012, 7:48 PM
I'm trying to get a List to show Json data. Dbl Clicking the Eye icon shows the data I'm expecting:

[
{
"Id": 1,
"Name": "Tomato Soup",
"Category": "Groceries",
"Price": 1.0
},
{
"Id": 2,
"Name": "Yo-yo",
"Category": "Toys",
"Price": 3.75
},
{
"Id": 3,
"Name": "Hammer",
"Category": "Hardware",
"Price": 16.99
}
]

The correct data shows on the Canvas. In Chrome preview, all I get is a blank screen, the size of the list.

AutoLoad is ticked.;)

Any ideas?

heloWelo
24 Aug 2012, 8:00 PM
OK, so I changed it to a JsonP proxy as I'm calling the data from a different directory on LocalHost

Now, if I run the app, I get a Loading screen but after a while it goes to the white rectangle.

No errors are showing in Chrome developer tools.

heloWelo
25 Aug 2012, 3:15 AM
Well, I can get data onto the canvas using an Ajax Proxy but when I try using the JsonPproxy, I get nothing. It looks like it tries to load but then gives up and says it can't get the data in that configuration. When I click on the link, it gives me the data.

So, now I have a JsonPstore, a JsonPProxy and a JsonReader but it doesn't let me pull in the data. Changing to an Ajax proxy lets me see data in the canvas but running in the browser I get an error about Access Control Lists - due to a cross domain call on LocalHost.

What am I missing with JsonP calls? The right data is definitely there!

heloWelo
25 Aug 2012, 7:24 PM
I have tried all sorts of stores and proxys in order to get JsonP data but with no joy.

When I look at developer tools in Chrome, and then Preview, the data is right there but the App wont display it - I just get the spinning loading graphic and then a blank page.

heloWelo
27 Aug 2012, 1:40 AM
I can get the Ext example to work with an OverRide but not with a Drag and Drop JsonP Store.

Does Architect write the correct code?

It seems strange to me that Architect generated code is different and cant make it work.

If you drag and drop the JsonP proxy, it''' give you: extend: 'Ext.data.Store'

The code example that works is: Ext.data.JsonP.request

I can't get working code from Architect. Anyone get an example to work?