Re-enabling pager buttons on JQGrid

僤鯓⒐⒋嵵緔 提交于 2019-12-01 08:59:56

问题


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

Any help is appreciated!


回答1:


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:

  • 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}"


来源:https://stackoverflow.com/questions/8061632/re-enabling-pager-buttons-on-jqgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!