重新启用JQGrid上的寻呼机按钮 [英] Re-enabling pager buttons on JQGrid

查看:95
本文介绍了重新启用JQGrid上的寻呼机按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要定制的带有分页器按钮的jqgrid,并且我希望在网格绑定后(如果我的初始查询仅填满一个页面时)保持不禁用按钮(下一个,前进,第一个和最后一个),按钮将被禁用).我在reloadGrid之后尝试了以下操作,但无法正常工作.

I have a jqgrid with pager buttons that I want to customize and I would like to keep the buttons (next, forward, first and last) from being disabled once the grid is binded (if my initial query only fills one page, the buttons get disabled). I have tried the following after reloadGrid but it's not working.

    $("#MyGrid pgbuttons").removeClass("ui-state-disabled") 

感谢您的帮助!

推荐答案

如果仅由于您不知道记录数和数量而需要启用寻呼机的下一步"和最后"按钮您可以在其中的页面中进行以下操作:

If you need to have the "Next" and the "Last" buttons of the pager enabled just because you don't know the number of records and the number of pages which you has you can do following:

  • 放置在服务器响应中的total值至少比当前请求的页面高一个.例如:"page":1, "total":2.
  • 修改jqGrid的pgtextrecordtext选项(请参见文档).例如pgtext : "Page {0} of ..."recordtext: "View {0} - {1} of ..."或仅pgtext : "Page {0}"recordtext: "View {0} - {1}"
  • place in the server response the total value at least one higher as the current requested page. For example: "page":1, "total":2.
  • modify pgtext and recordtext options of jqGrid (see the documentation). For example pgtext : "Page {0} of ..." and recordtext: "View {0} - {1} of ..." or just pgtext : "Page {0}" and recordtext: "View {0} - {1}"

这篇关于重新启用JQGrid上的寻呼机按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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