I am trying to use jQuery jqGrid plugin with asp.net mvc application.
I pass 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 setting jqGrid:
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 a hit on my action, but the grid got stuck at boot, any ideas what I'm doing wrong?
thanks