, , ( ), , Grand Total ... , , , 3 , 1
1 ,
dataView.setAggregators([ new Slick.Data.Aggregators.Sum("value") ], false);
2nd ( ) , groupTotalsFormatter
var columns = [
...
{id: "cost", name: "Cost", field: "cost", width: 90, sortable: true, groupTotalsFormatter: sumTotalsFormatter}
];
, ,
function sumTotalsFormatter(totals, columnDef) {
var val = totals.sum && totals.sum[columnDef.field];
if (val != null) {
return "total: " + val;
}
return "";
}
- , , .