BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
@(Html.EJ().Grid<object>("Grid") . . . . .SummaryRow(row => { row.SummaryColumns(col => { col.SummaryType(SummaryType.Custom).CustomSummaryValue("TimeSpanCounter").Format("{0:D2}").Add(); }).Add(); }) <script type="text/javascript"> function TimeSpanCounter(summary, data) {
data = ej.select(data, ["WorkedHours"]);
//Helper to calulate the total time var getter = function (prop, divisor, prev) {
var f = ej.select(data, [prop]), sum = 0 + (prev || 0);
sum += ej.sum(f);
if (prop == "Hours") return sum;
return { prev: ~~(sum / divisor), org: sum % divisor }; };
var sec = getter("Seconds", 60), min = getter("Minutes", 60, sec.prev), hours = getter("Hours");
return this.formatting(summary.format, hours) + " : " + this.formatting(summary.format, min.org) + " : " + this.formatting(summary.format, sec.org); }
|