Is it possible to sum the datas from a filtered column?
Is it possible to sum the datas from a filtered column?
Hi,
I would like to know how it is possible to get a sum of a filtered column?
For example I have 300 datas after filtering there are only 30 and I would like to have the sum of those 30 datas.
If its not filtered it should show the sum of all 300 datas.
Can someone help me with the code?
I would like to know how it is possible to get a sum of a filtered column?
For example I have 300 datas after filtering there are only 30 and I would like to have the sum of those 30 datas.
If its not filtered it should show the sum of all 300 datas.
Can someone help me with the code?
This discussion has been closed.
Replies
but I'm not sure how to implement the code [code]$('#example').dataTable()._('td:nth-child(4)', {"filter": "applied"})[/code] in this code: [code]$(document).ready(function() {
$('#example').dataTable( {
"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
/*
* Calculate the total market share for all browsers in this table (ie inc. outside
* the pagination)
*/
var iTotalMarket = 0;
for ( var i=0 ; i
I solved the problem by myself...
[code]
"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
var oTable1 = $('#example').dataTable();
var oTable2 = $('#example').dataTable();
var data = oTable1._('td:nth-child(5)', {"filter": "applied"});
var data2 = oTable2._('td:nth-child(4)', {"filter": "applied"});
var summe = 0;
var summe2 = 0;
for ( var i = 0; i