1

i am currently trying to solve my problem with the total in the footer. i tried searching in the internet with some examples, but they are using php, and i am using java. can you please show me what exactly the json looks like for this php script

$response->userdata['total'] = 1234;
$response->userdata['name'] = 'Totals:'; 

is this what it looks like?

{"total":0,**"userdata":[{"total":1234,"name":"Totals"}]**,"page":0,"aData":.....

thanks.

Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
Dennis
  • 31
  • 1
  • 1
  • 5

2 Answers2

3

userdata must look like

"userdata":{"total":1234,"name":"Totals"}

instead of

"userdata":[{"total":1234,"name":"Totals"}]

to be able be displayed in footer if your columns have names "total" and "name".

Oleg
  • 220,925
  • 34
  • 403
  • 798
0

by default, the key data you need for the jqGrid footer in your json response are page, total and records, so in your json response make sure you have something that looks like this:

{"page":"1","total":2,"records":"13","rows":[{....}]}
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
lomaxx
  • 113,627
  • 57
  • 144
  • 179
  • this is my sample json, "{"total":1,"page":1,"records":2,"userdata":[{"description":"Total:","amount":30}],"aData":[{,"id":1,"description":"DESCRIPTION FOR ROW 1","amount":10},{"id":2,"description":"DESCRIPTION FOR ROW 2","amount":20}]}".... is the format correct for userdata? – Dennis May 10 '10 at 11:54