Hallo,
we use summaries feature and we want to add units to summaries on a per column basis. But we can only set a summary resultTemplate for the whole grid. how can we achieve this?
See: http://jsfiddle.net/maxschaf/xBMDs/3/
Hello Max,
Thank you for the sample.
I am currently looking into your question and will keep you posted of my progress.
Thank you for your patience.
The summaries behavior does not currently directly offer the functionality of setting per column result templates. Please feel free to submit a product idea regarding this functionality at: <ideas.infragistics.com>.
In this case I would suggest not using the result template, but instead handling the summariesCalculated event and manually modifying the summary text for the desired column:
http://jsfiddle.net/xBMDs/4/
Hope this helps. Please do not hesitate to contact me with any questions.
hi,
thanks for your answer. Your solution using jQuery Selectors works, but selecting the cell out of the DOM and manipulating it is slow for large grids.
I experienced, that setting a formatter function to a column also effects the summary generation, so it's possible to style/template the summary at generation time without dom manipulation. But this behavior is a bit strange. Setting a template to a column does not effect summary generation, but setting a formatter does :P .
I experienced this execution sequence:
- 1. formula (applied to every cell)
- 2. formatter (applied to every cell and every summary operand afterwards)
- 3. template (applied to every cell)
to prevent the cell style from being applied twice (wrong e.g. "12.44 ha ha" => right "12.44 ha"), I only format strings by the formatter function, because summaries calls the formatter function with strings (regional settings applied) and a cell calls the formatter with a number (using it in a dataType: number column).
to apply the regional settings to cell values automatically by iggrid I have to use a column template there, because a cell calls the formatter function with a non-formatted number instead of a formatted string.
see the magic happening: http://jsfiddle.net/maxschaf/xBMDs/5/
Thank you for sharing your solution!
well. my solution is not working correctly after all. if a formatter function is defined, templating is working. but the regional settings to numbers are not applied.
is this a bug or a feature? :)
it not really clear, when which templating, formatting, format property is working where. What influences editors, summaries,... . you should provide a flowchart or some graphics :) .
Hello maxschaf,
Thank you for your feedback.
We'd like to ask you to log a new product idea at http://ideas.infragistics.com because that way we are keeping track of customers' ideas, votes and comments on them.
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.
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.
thanks for your concerns.
using the formtter function, it would be nice, if one could call some iggrid-method to format a number by the iggrid regional settings, instead of formatting a number manually. this cool regional feature is useless if I have to format numbers manually again (using formatter).
please file a feature request for a public iggrid method, which formats numbers to regional strings.
thanks.
Please feel free to contact me if you have any further questions regarding this matter.
I have researched this further and there seems to be no other approach of implementing this in this scenario since the formatter function does not apply any regional or other formatting on its own (by design its purpose is to leave the formatting completely to the developer).
I would suggest considering directly changing the values in the summary cells again. Note that since the summary information is located into a separate table than the grid cells, the performance effect should be limited. Please let me know if you are experiencing performance issues in a larger grid with the current selector, as this should not happen at the moment. I would suggest considering to submit a product idea regarding the ability to specify per-column summary templating functionality.
Please do not hesitate to contact me if you have any questions.
Hi Max,
My apologies, I misunderstood the issue. I am currently looking into that matter and will keep you posted of my findings.