Paginator like remylab.github.com/jpaginator/

Paginator like remylab.github.com/jpaginator/

lzzlucalzzluca Posts: 9Questions: 0Answers: 0
edited October 2012 in General
Hi guys,
it is the first i write in this forum but i checked it often looking for help!
I would like to have a paginator like this one:
http://remylab.github.com/jpaginator/
because i have an huge range of pages and i think something like that can be really helpfull.
It is something like that already done?
Could be easy to use jPaginator instead of the built in paginators?
Thank you,
Luca

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    I'm not aware of an existing integration between jpaginator and DataTables, but I don't see any reason why it couldn't be done. You'll be interested in the pagination plug-in documentation for DataTables here: http://datatables.net/development/pagination .

    If you create a method to integrate the two, I'm sure others would be very grateful if you would share your solution with us all!

    Allan
  • lzzlucalzzluca Posts: 9Questions: 0Answers: 0
    Thank you for the answer!
    I think i am going to do that... If it will be, i'll of course share my work here!
  • ernaniazernaniaz Posts: 1Questions: 0Answers: 0
    Hi!

    I was searching for that too, but didn't find, so, I wrote my own plugin.
    I've published it at my blog, http://www.intellinews.com.br/blog/2012/10/26/jquery-datatables-integration-with-jpaginator-4/ (english) or http://www.intellinews.com.br/blog/2012/10/26/integrando-jquery-datatables-com-jpaginator/ (pt_BR).

    I hope it helps you.

    Cheers,
    --
    Ernani Azevedo
  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    Superb! Thanks very much for sharing your solution with us Ernani! Thanks also for your mail with a bout about this. I'll reply by e-mail shortly :-)

    Allan
  • lzzlucalzzluca Posts: 9Questions: 0Answers: 0
    edited November 2012
    Thank you ernaniaz!
    The plugin you built is really easy to read and works good!
    But i have some question for you guys, if you can help me:

    1) in 'fnInit' i had to comment the nbPages property, like this:
    selectedPage: null,
    //nbPages: 1,
    nbVisible: 6,
    If i don't, i get a "too much recursion" error. It makes any sense to you? I wasn't able to figure
    out a why...

    2) I had to keep 'fnUpdate' as empty function or i get all NaN insted of pages number... :(

    3) Related to the point 2, i wan't able to get the total pages number in this way:
    oSettings.oInstance.fnPagingInfo ().iTotalPages
    It is always 0... Do you have any idea about what i am doing wrong (the result is always 0)??

    4) Curious: if i use the "full_number" plugin i get the paginator at the top and at the bottom of the
    datatable, using "jPaginator" i get it only on the bottom... :O

    I hope my questions aren't stupid...
    Thank you,
    Luca
  • lzzlucalzzluca Posts: 9Questions: 0Answers: 0
    edited November 2012
    The points 1, 2 and 3 are now fixed, for more information read here:
    https://github.com/remylab/jpaginator/issues/3
    The point 4 is still opened: i am not able to get the jPaginator at the top and the bottom of Datatable... can you help me?
    Thank you,
    Luca

    PS: i removed the tag NAV from the plugin to make it running on not HTML5 browsers as well
  • lzzlucalzzluca Posts: 9Questions: 0Answers: 0
    edited November 2012
    Here the code to get the two jPaginator plugin (on top and bottom): the code needs to be seen again (the bottons ids should be constants defined somewhere and i don't like the settings object filled inside fnInit) but it can be a good start for who needs it. Better if someone will merge the original plugin and my fork and make one plugin only, with jPaginator settable position (top, bottom, both).
    I am going to leave it and write a plugin to get jPaginator on the top and the "full_number" paginator on the bottom. I will share it for who would like to use it.
    Here the code for the top and bottom jPaginator:
    https://github.com/lzzluca/jPaginator4Datatable
This discussion has been closed.