JQuery网格分页不可见

JQuery grid pager not visible

本文关键字:分页 网格 JQuery      更新时间:2023-09-26

我有一个Jquery网格,它是在一个html表格上形成的。

我已经为网格添加了所需的属性,包括分页功能。我把页面大小设置为10。

页面向上和页面向下按钮不可见。

当我仔细看时,我发现上面写着Page: 1 out of 1但在右下角,它又显示257条记录中的1-10条。

这里是我的html标签

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

下面是绑定网格的代码。

$("#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});

有什么建议我错过或做错了吗?

尝试使用loadonce: true, forceClientSorting: true选项