Aaron Reba
Aaron Reba

Reputation: 759

Changing the footer of DataTables

I'm trying to change the footer of dataTables to be a custom defined one. Instead of "Showing x to y of z entries." I want it to show "Showing x to y of (my own value) entries." DataTables bases the entry count off of the number of rows in the table, but I want it to show a count of entries in a database.

    $('#' + table_name).dataTable({
      "oLanguage": {
        "sInfo": "Showing blah to blah of my_own_number entries."
      }
    });

Though, I'm getting this error:

Uncaught TypeError: Cannot set property 'aaSorting' of null

Instead of using any variables in the message, I'm just trying to change the message for now to something like "hello new footer." instead of "Showing...entries" but even using a simple message like this results in the same error.

Upvotes: 1

Views: 1914

Answers (1)

Ricardo Lohmann
Ricardo Lohmann

Reputation: 26320

Try the following:

"sInfo": "Showing _START_ to _END_ of " + my_own_number + " entries."

Upvotes: 1

Related Questions