jqGrid分页问题

发布于 2024-09-25 03:19:52 字数 279 浏览 0 评论 0原文

如果您有 17 条记录并且一次显示 15 条,那么当您在第 2 页上时,您会看到 17 条记录中的第 16-17 条记录 - 这是有道理的。

现在,当您在第二页上并点击导航上的重新加载按钮(设置 datatype='json')时,当网格重新加载时,导航显示网格正在显示 17 中的 16-30。这似乎是错误 - 有解决方法吗?

网格仍然有 17 行 - 但它试图在第二页上显示完整的 15 行(rowNum)设置,而它应该只显示两行(16-17)。并且导航分页文本不正确(指的是 30 行,而只有 17 行)。

If you have 17 records and are displaying 15 at a time then when you're on page 2 you see records 16-17 of 17 - makes sense.

Now when you're on this second page and you hit the reload button on the nav (set datatype='json') when the grid reloads the nav is showing that the grid is displaying 16-30 of 17. This seems to be a bug - is there a workaround?

The grid still has 17 rows - but it's trying to show a full 15 rows (the rowNum) setting on the second page when it should only be showing two rows (16-17). And the nav pagination text is incorrect (referring to 30 rows when there is only 17).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冰魂雪魄 2024-10-02 03:19:52

你是对的。这是一个老问题了。我以前一直用过,

$("#list").setGridParam({page:1}).trigger('reloadGrid');

但还有另一种方法。触发器“reloadGrid”支持附加选项:“当前”和“页面”。

$("#list").trigger("reloadGrid", [{page:1}]);

将一步将 page 重置为 1。表单中的使用

$("#list").trigger("reloadGrid", [{current:true}]);

允许保留当前选择。您当然可以将这两个选项结合起来。

You are right. It is an old problem. I used always before

$("#list").setGridParam({page:1}).trigger('reloadGrid');

but there is another way. The trigger 'reloadGrid' support additional options: 'current' and 'page'.

$("#list").trigger("reloadGrid", [{page:1}]);

will reset page to 1 in one step. The usage in the form

$("#list").trigger("reloadGrid", [{current:true}]);

allows to preserver current selection. You can of cause combine both options.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文