Sum values of each row with paging
Sum values of each row with paging
Hi,
I have a very big table (5 cols x 116k rows) containing population numbers.
I need to sum the column containing the population and that this sum changes with the filters applied (I''m using the main filter + the multi filters per columns https://datatables.net/examples/api/multi_filter.html )
I tried using the sum api : https://datatables.net/plug-ins/api/sum()
It works, but it only gives the sum of the visible rows.
How can I get the sum of all the rows, except those filtered out when I type something in the search fields ?
I also tried the https://datatables.net/examples/advanced_init/footer_callback.html
It also works but same problem: only sum of visible rows, not other pages.
I would prefer using the second method (footer callback) if possible, it's all in one place, easier to maintain.
Thanks!
Answers
Found it.
Have to use