From 6aa3a457543d32970b271c16fc1cdf097cd36f85 Mon Sep 17 00:00:00 2001 From: Kai Philipp Date: Thu, 30 Jan 2020 11:17:47 +0100 Subject: [PATCH] reports - sum added --- js/reports.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/js/reports.js b/js/reports.js index 2332685..a1e4f91 100644 --- a/js/reports.js +++ b/js/reports.js @@ -181,7 +181,20 @@ return h + ':' + m + ':' + s; - },}, //column will be allocated 1/5 of the remaining space + },bottomCalc:"sum", bottomCalcParams:{ + precision:1, + },bottomCalcFormatter:function(cell, formatterParams, onRendered){ + //cell - the cell component + //formatterParams - parameters set for the column + //onRendered - function to call when the formatter has been rendered + var duration = cell.getValue(); + var s = Math.floor( (duration) % 60 ); + var m = Math.floor( (duration/60) % 60 ); + var h = Math.floor( (duration/(60*60))); + + return h + ':' + m + ':' + s; + + }}, //column will be allocated 1/5 of the remaining space ], ajaxResponse:function(url, params, response){ @@ -201,4 +214,4 @@ } ); -}()); \ No newline at end of file +}());