在jqgrid中禁用下一个/最后一个寻呼机 [英] Disable Next/Last Pager in jqgrid
问题描述
我正在使用jqGrid
,其中即使在应用过滤条件期间jqgrid中没有记录的情况下,也启用了Next/Last
分页器.
我有一个@Oleg
演示,其中首先在寻呼机中显示的行数中选择"5".然后过滤不显示任何记录的网格.现在,您可以看到在禁用Previous/first
的情况下Next/Last
寻呼机按钮仍处于启用状态.
我需要禁用First/Previous
,Next/Last
和rowList
(5,10,20,50).
我正在使用datatype:local
,但我没有使用loadonce:true
.
这是演示
我假设您将datatype: "local"
或datatype: "json"
或datatype: "xml"
与loadonce: true
一起使用.在这种情况下,我建议您添加以下localReader
: localReader: {
page: function (obj) {
if (obj.rows == null || obj.rows.length === 0) {
return "0";
}
}
}
它应该通过启用寻呼机中的下一个"和最后一个"按钮来解决该问题.
I'm using jqGrid
in which the Next/Last
pager is enabled even when there is no records in the jqgrid during a filter condition is applied.
I have a demo of @Oleg
, in which first select "5" in the number of rows displayed in the pager. Then filter the grid in which it shows no records. Now you can see the Next/Last
pager button still enabled while the Previous/first
is disabled.
I need to disable the First/Previous
, Next/Last
and the rowList
(5,10,20,50).
I'm using the datatype:local
but i dont use loadonce:true
.
Here is the Demo
I suppose that you use datatype: "local"
or datatype: "json"
or datatype: "xml"
together with loadonce: true
. In the case I would recommend you to add the following localReader
:
localReader: {
page: function (obj) {
if (obj.rows == null || obj.rows.length === 0) {
return "0";
}
}
}
It should fix the problem with enabled Next and Last buttons in the pager.
这篇关于在jqgrid中禁用下一个/最后一个寻呼机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!