Equal number of paging buttons around ellipses in pagination

Equal number of paging buttons around ellipses in pagination

AntrikshAntriksh Posts: 33Questions: 5Answers: 0

i want to have equal number of pagination buttons arround ellipses in the pagination.
For example i am using default simple_number as pagingType and have given -
$.fn.DataTable.ext.pager.numbers_length = 5

Currently its showing as - Previous 1 2 3 ... 7 Next

Expected - Previous 1 2 ... 6 7 Next

Please help.

Answers

  • kthorngrenkthorngren Posts: 20,383Questions: 26Answers: 4,781

    Not sure if this plugin works the way you want but you may be able to modify to fit your needs:
    https://datatables.net/plug-ins/pagination/ellipses

    Kevin

  • AntrikshAntriksh Posts: 33Questions: 5Answers: 0

    @kthorngren this plugin is deprecated and says this functionality works for version 1.10. I am using 1.10.21 but ishowOption is not working in that. If you can give any example of ishowOption.

  • kthorngrenkthorngren Posts: 20,383Questions: 26Answers: 4,781
    edited July 2020

    this plugin is deprecated and says this functionality works for version 1.10

    Yes but you can use that plugin (or any other) as a basis to modify as needed for your solution.

    If you can give any example of ishowOption.

    I'm not sure what you mean. The plugin uses ishowOption. Are you trying to use this with the builtin paging? Not sure if the builtin plugin uses ishowOption.

    You can see this plugin working here:
    http://live.datatables.net/qogaxegi/1/edit

    I placed the code in the JS tab so you can modify as needed.

    Kevin

This discussion has been closed.