【问题标题】:JQuery grid pager not visibleJQuery 网格寻呼机不可见
【发布时间】:2016-11-18 12:33:11
【问题描述】:

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

我已为网格添加了所需的属性,包括寻呼机功能。我已将页面大小设置为 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});

对我遗漏或做错了什么有什么建议?

【问题讨论】:

  • 请务必在所有问题中填写有关您使用(可以使用)的 jqGrid 的 版本 以及 jqGrid 的 fork 的信息,这一点很重要(free jqGrid,商业Guriddo jqGrid JS 或版本 url)返回的数据(至少两行数据)的示例。可能您没有实现服务器端分页。 257 行数据并不真正需要。您可以一次返回所有数据并使用loadonce: true, forceClientSorting: true选项

标签: javascript jquery asp.net-mvc-4 jqgrid jqgrid-asp.net


【解决方案1】:

尝试使用loadonce: trueforceClientSorting: true 选项。

【讨论】:

    猜你喜欢
    • 2011-05-19
    • 2012-11-24
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    • 2011-05-10
    • 2011-07-23
    • 1970-01-01
    • 2011-10-26
    相关资源
    最近更新 更多