13
IM using jqgrids on mvc4, I need to get a simple list and display it using Ajax.
When I load the page then grid starts an Ajax call, I have only 2 columns on grid, user_id and name.
When the Json is loaded I get the next error on Google chrome:
Uncaught Typesetter: Cannot read property 'integer' of undefined
and in firefox, firebug:
TypeError: b.jgrid.formatter is undefined
on jquery.jqGrid.src.js:122
And the grid shows an "undefined" msg, also, the current pageer control isnt loading, but the data is
<table id="GridUsuarios"></table>
<div id="PagerUsuarios"></div>
<script type="text/javascript">
$(document).ready(function() {
jQuery("#GridUsuarios").jqGrid({
url: '@Url.Action("UsuariosGridData","Usuarios")',
datatype: "json",
myType: 'GET',
contentType: "application/json; charset-utf-8",
colNames: ['Usuario', 'Nombre'],
colModel: [
{ name: 'user_id', index: 'user_id', width: 90},
{ name: 'nombre', index: 'nombre', width: 200}
],
pager: '#PagerUsuarios',
rowNum: 10,
rowList: [10, 20, 30],
viewrecords: true,
height: 'auto',
sortname: 'nombre',
sortorder: 'desc',
caption: "Usuarios",
jsonReader: {
root: "rows",
total: "total",
page: "page",
records: "records",
repeatitems: false,
id: "user_id"
},
});
});
</script>
and my controller:
public JsonResult UsuariosGridData(string sidx = "