Customizing the page numbers to show in pagination using jquery datatables

Customizing the page numbers to show in pagination using jquery datatables

imNoobimNoob Posts: 3Questions: 0Answers: 0

Hi,
I am using jquery datatable and I am getting the total no of records. I just can't figure out how to set the value for page numbers. note: I am using custom pagination. Only thing I want to modify is total Pages so I can implement my own pagination. similar to this question(). but I am using 1.10.20. Is there any possible solutionhttps://stackoverflow.com/questions/16424147/how-to-display-numbers-only-in-pagination-of-jquery-datatables

Replies

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    You can use pagingType set to numbers for that, see here.

    Colin

  • imNoobimNoob Posts: 3Questions: 0Answers: 0
    edited February 2020

    Hi colin, I am doing custom pagination. I have created events for previous and next now I am getting all values like total records, no of pages etc. Is there any way I can override these with datatable pagination like is there any way I can render my page numbers with datatable without breaking anything

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    If it's custom pagination, then you can do whatever you're coding it to do. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • imNoobimNoob Posts: 3Questions: 0Answers: 0
    edited February 2020

    Thanks for your reply, currently I am looking to override DataTable.ext.pager values so I can use them to create a plugin $.fn.dataTableExt.oPagination.custom = function(page, pages) to override function _numbers(page, pages) parameters.
    whats your thought on this

This discussion has been closed.