views:

312

answers:

3

hi. 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.

A: 

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":[{....}]}
lomaxx
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
A: 

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
A: 

I have one question on this, can we make footer table expandable. Because, i have a requirement to show the total in one row and on click of expand button i have to show the segregation of the total. Can anybody help me how should i make footer row expandable?

Rupesh