[Filtering] Get the total of one column in real time
[Filtering] Get the total of one column in real time
Hello world,
I've built a table with datatable, and included the Filtering plug-in.
Among the informations of each row is a number of hours spent.
The question is : How can I calculate the total amount of hours in real time (So while using the Filtering plug-in) ?
Thx in advance,
Zirion
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Where and how are you trying to use this?
You can use
selector-modifier
of{search: 'applied}
withrows()
,column()
orcell()
APIs to get the filtered data set. For further help please provide a test case showing what you are trying to do so we can provide more specific help.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
On the same page, I want to display the sum of the "Heures" column, considering the search bar's results, and I can't really see how selector-modifier could help me with that...
Take a look at the Footer Callback example. It shows how to sum just the page. You can do the same but change it to
{search: 'applied}
. If you still need help please provide a running test case so we can help update your code.Kevin
Thank you,
The Footer Callback Example helped me a lot, I just modified some parameters and set my input as "number" instead of "test", and by now my result is shown.