How to change the Page # in DataTables in the Pagination bar?

How to change the Page # in DataTables in the Pagination bar?

yousufsadatyousufsadat Posts: 25Questions: 11Answers: 0
edited June 2017 in Free community support

Hi. I've posted this question in StackOverFlow too https://stackoverflow.com/questions/44789753/how-to-change-the-page-in-datatables-in-the-pagination-bar.

What I want to know is how to modify the Page# on the pagination bar. Instead of 1 2 I want to show a text "Page" 1(first page#) text "of" 10 (total number of pages)

Page 1 of 10

So far I've used these properties in my constructor

$(document).ready(function() {
        $('#esignTable').DataTable({"pageLength":5, "pagingType":"full_numbers", "sDom": '<"top"flp>rt<"bottom"i><"clear">', "oLanguage": { 
            "sEmptyTable": " ", 
            "oPaginate": {
                   "sNext": '<img src="../images/integration/SlowRight.jpg">',
                   "sPrevious": '<img src="../images/integration/SlowLeft.jpg">',
                   "sFirst": '<img src="../images/integration/FastLeft.jpg">',
                   "sLast": '<img src="../images/integration/FastRight.jpg">',
                 }
               }
        });
    });

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin
    Answer ✓

    Use the language.info option. You would set it to be something like Page _PAGE_ of _PAGES_.

    Allan

  • yousufsadatyousufsadat Posts: 25Questions: 11Answers: 0

    I did that and it is working fine just like JQGrid input field. Thanks Allan.

This discussion has been closed.