Forum


15:52

09/07/2009

I have been fighting the JSON monster all mornin and I'm afraid he's winning, I can not figure away around this to get JQGrid working.
I'm using the JSON with Zend Framework, I don't see where any options can be specified when you call the encoding function. I've also tried a different version of JSON.php as well. I'm getting curly brackets ({}'s) instead of the other brackets ([]'s) to outline the rows section.. JQGrid does not render anything with these type of brackets… Any ideas would be very much appreciated on a way to work around this.
Thanks, Brandon
Does not work.. this is what the PHP JSON RETURNS
{”page”:1,”total”:4,”records”:323,
“rows”:{
“1″:{”id”:”0000020003″,”cell”:["0000020003","username-1"]},
“2″:{”id”:”0000020003″,”cell”:["0000020004","username-2"]}
}}
This works
{”page”:1,”total”:4,”records”:323,
“rows”:[
"1":{"id":"0000020003","cell":["0000020003","username-1"]},
“2″:{”id”:”0000020003″,”cell”:["0000020004","username-2"]}
]}
16:24

09/07/2009

I've noticed more differences between my working version and what is being returned…
Actually, a lot of differences, including quotations, brackets, etc…. I'm going to punt and try xml or build the json string manually.
Just thought I would mention it if anyone else decides to try JSON with the Zend Framework & JQGrid.
15:18

This is working for me:
public function indexAction() {
$response->page = 1;
$response->total = 4;
$response->records = 22;
$response->rows = array(
array("id" => 1, "cell" => array("Quantum of Solace","Marc Forster","2008","Daniel Craig","200")),
array("id" => 2, "cell" => array("Casino Royale","Martin Campbell","2006","Daniel Craig","150")),
array("id" => 3, "cell" => array("Die Another Day","Lee Tamahori","2002","Pierce Brosnan","142")));
$this->_helper->json($response);
}
Most Users Ever Online: 715
Currently Online:
55 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66