I am trying to use the JQuery plugin jqGrid with an asp .net mvc app.
I am passing the grid a JSON object in the following format as in the jqGrid documentation:
{
"total":1,
"page":1,
"records":10,
"rows":
[{
"i":1,"cell":["foo","bar"]},
{"i":2,"cell":["foo1","barr"]},
{"i":3,"cell":["foo2","barrr"]}]
}
and the jqGrid is setup:
jQuery("#searchResults").jqGrid({
url: '/Customer/SearchResults/',
datatype: 'json',
mtype: 'GET',
colNames: ['Surname', 'Forename'],
colModel: [
{ name: 'Surname', index: 'Surname', width: 200, align: 'left' },
{ name: 'Forename', index: 'Forename', width: 200, align: 'left'}],
pager: jQuery('#pager'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'Id',
sortorder: "desc",
viewrecords: true,
imgpath: '/scripts/themes/coffee/images',
caption: 'My first grid'
});
Its hitting my action but the grid is stuck on loading, any ideas what I am doing wrong??
Thanks