在jqgrid中禁用下一个/最后一个寻呼机 [英] Disable Next/Last Pager in jqgrid

查看:58
本文介绍了在jqgrid中禁用下一个/最后一个寻呼机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jqGrid,其中即使在应用过滤条件期间jqgrid中没有记录的情况下,也启用了Next/Last分页器.

我有一个@Oleg演示,其中首先在寻呼机中显示的行数中选择"5".然后过滤不显示任何记录的网格.现在,您可以看到在禁用Previous/first的情况下Next/Last寻呼机按钮仍处于启用状态.

我需要禁用First/PreviousNext/LastrowList(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屋!

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