Trying to get a JSON output to work with jqGrid 'userdata' option.
The example given in the jqGrid PDF is to produce a JSON result like this;
{ total: "xxx",
page: "yyy",
records: "zzz",
userdata: {totalinvoice:240.00, tax:40.00},
rows : [
{id:"1", cell:["cell11", "cell12", "cell13"]},
{id:"2", cell:["cell21", "cell22", "cell23"]},
]
}
I have tried to make the userdata portion like this (with no luck);
var jsonData = new
{ ...
userdata = new string[] {"totalinvoice:240.00", "tax:40.00" }
...}
return Json(jsonData);
But that comes back in the JSON results looking like this;
userdata":["totalinvoice:240.00","tax:40.00"]
I presume this is something trivial, but I cant seem to figure out how to get the System.Web.JSON.JsonResult call to return the value as expected by jqGrid.