gpt4 book ai didi

javascript - 如何在 MVC 中处理 jqGrid 分页器

转载 作者:行者123 更新时间:2023-12-03 04:04:25 25 4
gpt4 key购买 nike

我想用自己的而不是jqGrid API来处理jqGrid Pager

JqGrid 所有数据都存储到缓存中,但我不想将所有数据存储到缓存中,我想存储数据用户要求的行号。

  • 当我单击寻呼机上的下一个或上一个按钮时,调用 Action 方法并发送相对页码和行的数据并显示。

  • 并更新寻呼机中的页码。

我的 HTML 代码:

    <div id="jqTable">
<table id="jqGridTable"></table>
<div id="jqGridTablePager"></div>
</div>

我的 JS 代码:

    $("#jqGridTable").jqGrid({
cache: false,
url: '@Url.Action("GetUserList", "Account")',
datatype: "json",
colNames: ['LoginID', 'Login Name', 'Group', 'Email ID'],
colModel: [
{ name: 'LoginID', hidden: true, index: 'LoginID', width: 300 },
{ name: 'LoginName', index: 'LoginName', width: 300 },
{ name: 'GroupID', index: 'GroupID', width: 200, sortable: false },
{ name: 'EmailID', index: 'EmailID', width: 300, sortable: false }
],
viewrecords: true,
rowNum: 5,
rowList: [5, 10, 20, 30],
pager: '#jqGridTablePager',
loadonce: true
});

请帮助我解决这个问题

最佳答案

来自 jqgrid 选项 documentation :

loadonce - If this flag is set to true, the grid loads the data from the server only once (using the appropriate datatype). After the first request, the datatype parameter is automatically changed to local and all further manipulations are done on the client side. The functions of the pager (if present) are disabled.

如果您不打算立即从服务器加载所有数据,请将此标志设置为 false(或者不要将其设置为全部,因为 false 是默认值)

关于javascript - 如何在 MVC 中处理 jqGrid 分页器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44625990/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com