In slickgrid, I put a total aggregator sum. It sums all the rows from that column (percents) and works fine. But now I am facing that I want only get the totals from the active percents. Column active is other column that contains 0 or 1.
In the column definition:
{id: "percent", name: "Percent", field: "percent", minWidth: 60, sortable: true, groupTotalsFormatter: sumTotalsFormatter, editor: Slick.Editors.Text}
function sumTotalsFormatter(totals, columnDef, id)
{
return "Total: " + Math.round(totals.sum[columnDef.field]) + "%";
}
The aggregators:
dataView.setAggregators([
new Slick.Data.Aggregators.Avg("percent"),
new Slick.Data.Aggregators.Sum("percent")
], false);
I have been trying different ways but no success (Putting a non showing second field to store only the active data, searching on how to modify an agreggator.. etc). Any idea?