I am using DataTables to create a table that is able to dynamically filter context. I am following the basic example, here.
However, I want to make one customisation: To display alphabetised results in my table, with a "title row" for each alphabet letter. Eg:
A
- Apple
- Avocado
B
- Bear
- Button
C
- Car
I have done this successfully (using Django
templating on the server side for the output), but the footer label Datatables shows by default is now incorrect, because it counts the title rows. In the above example it reads:
Showing 1 to 8 of 8 entries
When it should read:
Showing 1 to 5 of 5 entries.
Digging further, the info result is accessed via the API as "language": {"info": "Showing START to END of TOTAL entries",}
.
I have the ability to count and save the header rows as a variable (e.g. var headercount = 3
) from my Django template.
How do I modify the START
, END
, and TOTAL
in the DataTables API so that they are accurate on every page when cycled through?