I have installed the jquery grid in an mvc project and hooked it up to the jquery ui. Initial load is fine and see the calls to the action in the controller and the results are displayed as expected. If I click on any of the headers to sort - nothing happens and the action is not called in the controller. I don't have any errors in firebug - just no event.
Am i missing something?
public ActionResult GetRateTypes(string sidx, string sord, int page, int rows)
{
int totalPages = 1; // we'll implement later
int pageSize = rows;
int totalRecords = 3; // implement later
var jsonData = new
{
total = totalPages,
page = page,
records = totalRecords,
rows = new[]{
new {id = 1, cell = new[] {"1", "-7", "Is this a good question?"}},
new {id = 2, cell = new[] {"2", "15", "Is this a blatant ripoff?"}},
new {id = 3, cell = new[] {"3", "23", "Why is the sky blue?"}}
}
};
return Json(jsonData, JsonRequestBehavior.AllowGet);
}
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#list").jqGrid({
url: '/Configuration/GetRateTypes',
datatype: 'json',
mtype: 'GET',
colNames: ['Code', 'Name', 'Rate'],
colModel: [
{ name: 'Code', index: 'Code', width: 40, align: 'left' },
{ name: 'Name', index: 'Name', width: 40, align: 'left' },
{ name: 'Rate', index: 'Rate', width: 400, align: 'left'}],
pager: jQuery('#pager'),
rowNum: 1,
rowList: [5, 10, 20, 50],
sortname: 'Code',
sortorder: "desc",
viewrecords: true,
imgpath: '/css/blitzer/',
caption: 'Interest Rate Types'
});
});
</script>