1

I am displaying data in jqGrid where i need to show the userdata in footer of jqgrid. I am using Servlet as server side and my datatype is json. Manually i am formatting data as JSON type.

Here is my JSON data format:

{"page":"1",
"total":8,
"records":375,
"userdata":{'totalcdrcost':'302.92'},
"rows": [
{"id":"1","cell":[1,"2011-09-16","04:36:02","9035020090","00618956189189","00","13","00:01:09","ISD","9.6","Mumbai"]},
{"id":"2","cell":[2,"2011-09-16","04:35:14","9742796383","h","00","11","00:01:54","INCOMING","0","Mumbai"]},

Now i want to show this userdata on footer row for that i enabled footer row also.here is my footer code..

footerrow : true, userDataOnFooter : true

But no data is displayed in the jqGrid... I don't know is this because JSON data format is not correct or something else.

Any help will be highly appreciated..

Thanks in advance..

4

1 回答 1

0

JSON 响应的以下部分不正确:

"userdata":{'totalcdrcost':'302.92'}

它应该是这样的

"userdata":{"totalcdrcost":"302.92"}

是正确的 JSON。如果您想使用footerrow : true, userDataOnFooter : true选项,则来自部分的数据将显示在页脚中,因为网格userdata中存在列(如 中的属性)。"totalcdrcost"namecolModel

于 2013-10-28T18:25:16.263 回答