Is there a way to display only the SUM in the summaries instead of the SUM, MIN, MAX, AVG, and Count.
I basically want a Totals row at the bottom of my table with the SUM only of each column. Is that possible?
Hello Ryan,
Yes, that's possible. What you need to do is to specify that you need only the "SUM" displayed. This is achieved through the "columnSettings" object in the "features" array. Here is a code sample:
...
features: [
{
name: "Summaries",
columnSettings: [
{ columnKey: "ProductID", allowSummaries: true, summaryOperands: [ { "rowDisplayLabel": "Summary", "type", "SUM", "active": true } ] },
{ columnKey: "Name", allowSummaries: true, summaryOperands: [ { "rowDisplayLabel": "Summary", "type", "SUM", "active": true } ] },
{ columnKey: "ProductNumber", allowSummaries: true, summaryOperands: [ { "rowDisplayLabel": "Summary", "type", "SUM", "active": true } ] }
]
}
You need to specify for each column that, you need only the "SUM" operation. You can also refer to this sample. If you have any additional questions, please don't hesitate to ask.
Thanks,
Martin Stoev
Okay, so I found the answer. There was a typo in your code. This worked for me.
{ columnKey: "ProductCount", allowSummaries: true, summaryOperands: [{ "rowDisplayLabel": "Total:", "type": "SUM", "active": true }]}, { columnKey: "ItemCount", allowSummaries: true, summaryOperands: [{ "rowDisplayLabel": "Total:", "type": "SUM", "active": true }]}
Guys,
Is this still a valid way to do it in javascript?
I am trying to get this working in JS now and not through razor. As of right now, I am not able to get the columns to only display the sum calculation.
Martin -
Thanks for the response. That actually worked this time. I tried it earlier but I must have missed something as it didn't work then.
Only issue I have left is that when I enable the summaries and set it to custom so I can get this, I still see the 4 blank extra rows. Is there a way to eliminate them down to only the one I am using?