event pre filter?
event pre filter?
Hi,
I've a datatable with deferRender: true, and some custom filters.
I need, before filter the data and display accordely, to reset some variables.
Is there any pre filter event?
In short: I need to calculate some values and display the sum in the footer, for the filtered row (even if they are not displayed due to pagination, of course).
So I need to set sum = 0 before any filtering.
Any clues?
Replies
Here is a list of all the Datatables events. There isn't a pre filter event. Maybe
preDraw
will help??If you still need help please start by posting your Javascript code so we can see what you are doing to get a better idea of how to reset the variables. Better wold be a link to your page or a test case demonstrating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Tried it, but it's called "after" the filters.
Basically here's the filter I have:
which must sum, for each row that is within
someCondition
, theamount
value.Later, on the footer callback:
I need to display the
footerAmount
. But I don't know how to reset thefooterAmount
before filtering.Any helps?
It seems my reply is vanished? Or do you need to moderate?
Your post probably it the forums spam filter. If you are posting code please use Markdown code formatting. The problem might be pasting code that doesn't have Markdown formatting.
Kevin
if you have implemented your custom filters using ext.search.push something like this could work. "accum" is a global variable that you can use in your table footer or wherever it is required.
Yep, sorry, @markzzz , the spam filter grabbed it - it's released now and it's your penultimate reply. Please let us know if you're having problems still - hopefully the replies above have got you going,
Colin