PDA

View Full Version : Is my JSON correct



icydee
4 Oct 2007, 11:08 AM
I have tried the basic example grid control in the tutorial and it works fine getting data from the vinylfox domain.

I modified the code to get data from my own php script (based on the example) and if I run it from the command line I get something like the following.

({"total":"2","results":[{"id":"1","name":"john smith","title":"mr","hire_date":"2007-10-01","active":"1"},{"id":"2","name":"joe bloggs","title":"mr","hire_date":"2007-10-02","active":"1"}]})

(accepting that the callback is not set).

You should be able to make the call yourself at this URL to see what it returns.

http://icydee.com/ext/grid-paging/grid-paging-data.php

If you look at the grid control at http://icydee.com/ext/grid-paging/ you can see that it does not display any data.

I can only think that the JSON returned is not correct but can't see how to check it.

Any ideas?

devnull
4 Oct 2007, 11:34 AM
looking at it in firebug, the xhr call comes back empty.

icydee
4 Oct 2007, 11:41 AM
looking at it in firebug, the xhr call comes back empty.

I am still trying to find out how to get firebug to debug Ext. It is not intuitive.

icydee
4 Oct 2007, 11:47 AM
Found the problem.

I had installed php-json on this server. My command line php therefore worked but since I had not restarted apache...

So, restarted apache and it all works OK

Sorry for the noise...

devnull
4 Oct 2007, 11:50 AM
hey, it happens ;)
this (http://code.google.com/support/bin/answer.py?answer=77412&topic=12044) was just posted on ajaxian today, might help you get started with firebug. i believe theres a really good intro video floating around somewhere too.