简体   繁体   中英

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.

请尝试以下操作:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM