Footer sum of a hh:mm:ss data type column
Footer sum of a hh:mm:ss data type column
muscaiu
Posts: 6Questions: 4Answers: 0
I can get the footer total of a INT column like this:
footerCallback: function ( row, data, start, end, display ) {
var quantita = this.api(), data;
// Total quantita over all pages
total_quantita = quantita
.column( 5 )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Total quantita over this page
pageTotal_quantita = quantita
.column( 5, { page: 'current'} )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Update footer Column "quantita"
$( quantita.column( 5 ).footer() ).html(
pageTotal_quantita +' ('+ total_quantita +' total)'
);
My question is: how can i get the total of a hh:mm:ss data type column like in this picture: https://goo.gl/Xuf4ip
Thank you!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The hh:mm:ss should just be the output format of that column's raw data. So you should be able to have your own functionality summing up the raw data for that column.
I found the solution here: http://stackoverflow.com/questions/37433641/jquery-datatables-column-sum-of-hhmmss/37453739#37453739
Three methods I can think of:
Allan