Hi,
I have a Grid and I have turned on grid summaries like this for columns.
{ name: "Summaries", compactRenderingMode: true, resultTemplate: "{1}", columnSettings: [ { columnKey: "ABC", allowSummaries: true, summaryOperands: { type: "sum", RowDisplayLabel: "Total" } },
I have 2 questions regarding the summaries.
1. I want to disable the icons in the summary grid that let you do select the different kind of summary options. I don't want that icon.
2. I have a string column like "Name" as my first column, I want my footer / summary to show a static value ? "Total" or Sum there, how can I do that.
Hello Hamza,
You can disable the summary icon manually by inserting the following piece of code in, for example, the igGrid's rendered function:
$("td.ui-widget-footer").unbind();$(".ui-iggrid-icon-summaries").css("visibility", "hidden");$(".ui-iggrid-summaries-footer-icon-container").css("pointer-events", "none");
About your second issue you can specify what type of summary to be shown below a certain column by configuring summaryOperands, as in your code. This option takes an array of objects. For example:
columnSettings: [{ columnKey: "ABC", allowSummaries: true, summaryOperands: [ { type: "count", rowDisplayLabel: "Total" }]}]
I have attached a sample in reference to these issues.
Please feel free to contact me if you have further questions.
Regards,Ivaylo HubenovEntry-level developer
This is good. Thanks for this, however, I don't need to apply any operation like sum or anything, all I need is a static text under one column and other columns have operands. All I need is total with no sum or anything. Is that possible.
yes, it is possible. Every div (there is a div in each of these cells to contain text) in a cell, containing a summary operand has the class "ui-iggrid-summaries-footer-text-container", therefore you can change the text by the following query:
$(".ui-iggrid-summaries-footer-text-container")[columnIndex].innerText = "Total";