Change sinfo message with number of entries

Change sinfo message with number of entries

akshat05akshat05 Posts: 2Questions: 1Answers: 0

Hi,
I'm new to datatable. I want to customize sinfo message from "Showing START to END of TOTAL entries" to "Showing START to END of first TOTAL entries", if the total number of entries exceed 1000. and if the total number of entries is less than 1000 then it should display "Showing START to END of TOTAL entries".
How can I achieve this?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin
    Answer ✓

    You would need to use the infoCallback option for conditional formatting. With that you can provide a function that will implement whatever logic you like.

    Allan

  • akshat05akshat05 Posts: 2Questions: 1Answers: 0

    Hi allan, please can you elaborate it a bit, how and where I need to place this, I've tried to place it in datatales.js file, replacing the line
    "sinfo": "Showing START to END of TOTAL entries"

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin
    Answer ✓

    You would place it into the initialisation object of your DataTable - there is an example in the documentation I linked to above. There is no need to change the DataTables source file.

    Allan

This discussion has been closed.