Does anyone know of a way to set up jqGrid to use a numeric pager?
Instead of Page 1 of 20, I want to have the paging be like 1,2,3,4 > >> and when I click on 4 it would something like << < 4,5,6,7 > >>
I've seen how other grids do it, but I can't seem to find a built in way for jqGrid to do it. I may have a way to implement it, but I don't want to reinvent the wheel if there is something already out there. It would involve me adding custom buttons after getting userdata from the grid's data to determine the pages available.
Telerik's grid does it (http://demos.telerik.com/aspnet-mvc/grid).
Ohhh! During I wrote the code firegnom posted another implementation. Nevertheless better two working versions as no one.
I made small demo which demonstrate how the behavior with links in the pager can be implemented. I made the code so, that it can display the pager either in the form
(if
pginput: false
parameter of jqGrid are used) or in the formIn both cases the current page will not displayed in the list. How one can see I inserted the underlined style for the links. If you don't like it you should remove
from the demo. The working live demos you can see here and here.
The corresponding JavaScript code is full inside of
loadComplete
event handler:where
grid
andMAX_PAGERS
are defined asAnd here's one more possible solution.
It replaces the paging textbox with a list of links.
as far as i know there is no solution for that in jquery and you have to do it yourself . below i have working code for the pager :
and function which is making links
now to integrate this code with grid just add it when grid is created gridComplete event or something like that:
and also attach it to onPage event
to prevent flickering just add to your css
and again on gridComplete just add
as to the function patrameters: