How can I use the sum() plugin only on filtered data?
How can I use the sum() plugin only on filtered data?
veryaca
Posts: 11Questions: 4Answers: 0
This plugin is great: https://datatables.net/plug-ins/api/sum().
However, it seems to sum the entire column when I use it this way:
table.column( 2 ).data().sum();
Anyone knows how I can achieve this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I found a way to do it, but I'd like to confirm it's the right way to do it:
table.column( 2, {filter:'applied'}).data().sum();
Hi @veryaca ,
Yep, see this example here,
Cheers,
Colin