Use search for the total sum

Use search for the total sum

paintitblackpaintitblack Posts: 60Questions: 20Answers: 0

Hello,

I combinded the Footer callback function (https://datatables.net/examples/advanced_init/footer_callback.html) with buttons to search for categories like this:
buttons: [
{
text: 'All',
action: function ( e, dt, node, config ) {
var table = $('#example').DataTable();
table.columns( 1 ).search( "" ).draw();
}
},
{
text: 'Bought',
action: function ( e, dt, node, config ) {
var table = $('#example').DataTable();
table.columns( 1 ).search( "Bought" ).draw();
}
}
]

When I select a category (e.g. Bought, Sold, Observed...) the Footer callback sums the current page and alle values. I am looking for an third sum for the current category or otherwise how could I use the current seach for the sum?

Kind regards

Patrick

This discussion has been closed.