Good Morning,
I'm trying to change the layout of the groupBy summary row so that it's more inline with the rest of the grid. Currently when used it puts all the summaries in the group row without any kind of layout. I would like it to keep the summaries at least aligned with the columns they are associated with. I spent some time looking at the infragistics.lob.js and found where that row is generated but it doesn't appear to have any layout options, or i'm missing something. The function _renderGroupRow returns the TR used for this and with some tweaking i'm able to get it to look the way I want, but that doesn't allow me to continue using ignite ui unless I want to maintain my own one off code base.
Has this been resolved? Looking to implement this as well.
Hello Frank,
After looking into this and doing some research, having a custom formatting of this type has been determined to be a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
There are many benefits to submitting a product idea:
- Direct communication with our product management team regarding your product idea.- Notifications whenever new information regarding your idea becomes available.- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.- Allow you to shape the future of our products by requesting new controls and products altogether.- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea: 1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com (creating a new login if needed).2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)3. Add your product idea and be sure to be specific and provide as much detail as possible. • Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!• Include a link to this thread in your idea so product management will be able to look back at this case.
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thank you for contacting Infragistics.
I've attached another picture of how it should look. Pardon my amazing pen drawing skills. The code I updated to try and get the desired results removed the groupby columns so I added them back with pen :)
I want this to work just like a standard groupBy, some of the information got lost when I started editing the library and trying things out. The real end goal here is that if I set a column to be grouped by and want summaries, I want to see what I'm grouping by, and then the summaries under each respected column.
In the grid I set the groupBy columns and also set the summaries for specific columns.
{ name: "GroupBy", initialExpand: false, summarySettings: { multiSummaryDelimiter: " - ", summaryFormat: "#0.0000" }, columnSettings: [ { columnKey: "_scenario", isGroupBy: true }, { columnKey: "_year", isGroupBy: true }, { columnKey: "_month", isGroupBy: true }, { columnKey: "_feed", isGroupBy: true }, { columnKey: "_benefit", summaries: [{ summaryFunction: "sum", text: "-" }] }, { columnKey: "_hits", summaries: [{ summaryFunction: "sum", text: "-" }] }, { columnKey: "_orders", summaries: [{ summaryFunction: "sum", text: "-" }] }, { columnKey: "_feedMissRatio", summaries: [{ summaryFunction: "avg", text: "-" }] } ]}
The problem is that the summaries show up in the groupBy row as just a big string. I need them to align with their respectful column as shown in the picture. The code that controls that in the library is under the _renderGroupRow function:
textcell = "<td data-gbsummary='true' colspan='" + this._colspan + "' tabindex='" + this.grid.options.tabIndex + "'" + classAttr + ">" + text + "</td>";
The text variable comes from:
for (i = 0; i < cs.length; i++) { if (cs[i].columnKey !== field) { cscol = this.grid.columnByKey(cs[i].columnKey); htext = cscol ? cscol.headerText : cs[i].columnKey } else { htext = col.headerText } for (j = 0; j < cs[i].summaries.length; j++) { shtml += " " + htext + " " + (cs[i].summaries[j].text || cs[i].summaries[j].summaryFunction) + " " + cs[i].columnKey + cs[i].summaries[j].summaryFunction + "$$value$$"; if (j !== cs[i].summaries.length - 1) { shtml += this.options.summarySettings.multiSummaryDelimiter } } } text += shtml;
What I ended up doing which looks terrible and hacky was modify the the for loop to put each summary into it's own <TD> and then when the TR is returned on completion I just inserted a how ever many <TD></TD> I needed to push the content to it's correct position.
tr = "<tr class='" + this.grid.css.recordClass + " " + this.css.groupedRow + "' data-grouprow='true' data-state='" + state + "' data-glevel='" + indent + "'" + " aria-expanded='" + (!collapsed ? "true" : "false") + "'" + " aria-describedby='" + this.grid.id() + "_" + col.key + "'" + " title='" + $.ig.GridGroupBy.locale.summaryRowTitle + "'" + " data-id='" + gbRec.id + "'" + " data-row-idx='" + rowInd + "'" + " tabindex='" + this.grid.options.tabIndex + "' >" + expcell + "<td></td><td></td><td></td><td></td><td></td>" + textcell + "</tr>"; tr = tr.replace(new RegExp("__sum__", "g"), gbRec.recs.length); tr = this._calcRealSummary(tr, gbRec.fieldName, gbRec.val, gbRec.recs, gbRec.recs); return tr
This was just me testing and is by no means a valid solution as it's not even remotely scalable. I'm really hoping for a better solution where the grid can provide summaries in their respected column, or provide a way to use the Summary feature that adds a new row with the summary information. I can understand that using that way with GroupBy would be a lot more work with rendering the grid.
Thank you for contacting Infragistics!
Can you please describe the changes you have made and what it is you want to achieve. Looking at your image it looks like you don’t want to display any of the information concerning the actual grouped rows and want to display sums of the columns/rows you didn’t group by in the grouped rows?