jqGrid分页问题 [英] jqGrid paging question

查看:172
本文介绍了jqGrid分页问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您有17条记录并且一次显示15条,那么当您在第2页上时,您会看到记录17-17(共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.

现在,当您在第二页上时,当网格重新加载导航时,您在导航上单击了重新加载按钮(set datatype ='json'),这表明网格显示的网格数为16-30(共17).成为错误-有解决方法吗?

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?

网格仍然有17行-但是当它仅应显示两行(16-17)时,它试图在第二页上显示完整的15行(rowNum)设置.导航分页文本不正确(只有17行时,请参考30行).

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).

推荐答案

您是对的.这是一个老问题.我以前总是用

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

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

但是还有另一种方法.触发器"reloadGrid"支持其他选项:当前"和页面".

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

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

将一步将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.

这篇关于jqGrid分页问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆