How to calcualte total for column if I use filter?
How to calcualte total for column if I use filter?

I have a table, and I have a filtetration for it Like:
this.api().column(4).search(_some_filtration_).draw();
And I want to get total sum in footer, So I took code from example:
total_util = this.api.column(4).data().reduce( function (a, b) {return a + b}, 0 );
console.log(total_util)
But it will always give me the value without using any filter
This discussion has been closed.
Answers
It looks like I need to use
modifier
option for.column()
becauseBut I don;t know how to use it.
I got it. I should use
api.column(4, {'search': 'applied'}).data().reduce( function (a, b) {return a + b}, 0 );
can i get full code of this method
Hi @vinisha ,
If you combine @GhostKU 's final comment above, with this example here, you should be good to go,
Cheers,
Colin