Shekar.gvr Shekar.gvr - 14 days ago 6
Javascript Question

JQuery grid pager not visible

I have a Jquery grid which is formed on a html table.

i have added the required properties for the grid including the pager functionality.I have set my page size to 10.

The page up and page down buttons are no visible.

when i looked closely, i found that it is saying

Page: 1 out of 1

But in the right corner it again says 1-10 of 257 records.

Here aremy html tags

<table class="table table-bordered" id="tblJQGrid"></table>
<div id="pager"></div>


And here is the code for binding the grid.

$("#tblJQGrid").jqGrid(
{url: "@Url.Action("GetGeographyBreakUpData", "GeoMap")"+ "?Parameters=" + Params + "",
datatype: "json",
//data: { "Parameters": Params },

mtype: 'GET',
cache: false,
colNames: ['Id','GeoGraphy', 'Completed', 'InProgress'],
colModel: [
{ name: 'Id', index: 'Id', width: 20, stype: 'text',hidden:true },
{ name: 'Geography', index: 'Geography', width: 150 },
{ name: 'Completed', index: 'Completed', width: 150 },
{ name: 'InProgress', index: 'InProgress', width: 150 },
],
pager:'#pager',
jsonReader: {cell:""},
rowNum: 10,
sortorder: "desc",
sortname: 'Id',
viewrecords: true,

caption: "Survey Status:Summary",
scrollOffset: 0});
$("#tblJQGrid").jqGrid('navGrid','#pager',{search:true});


Any suggestion on what i am missing or doing wrong?

Answer

Try using loadonce: true, forceClientSorting: true option.

Comments