When I goupby and summary some rows. The summary infomation is displayed as a string, It looks not very clear.I have 2 questions.
1. Can I use a template on the summay infomation?
2. Can I display the summary infomation align with each column? Like the following diagram.
http://i.6.cn/cvbnm/2c/36/2d/9e122dbe95ef9ddb92857cea55d4e338.jpg
You can get the complete picture here.
My question is if I want to template "Standard Cost" column. Which Value I should set into template?
Sure thing.
Here's the updated description of the groupedRowTextTemplate option:
Template for the grouped row's text, follows jQuery's templating guidelines. Variables available for the template are ${key}, ${val} and ${count}.
So the shortest snippet I can give you off the bat is the option's default value:
groupedRowTextTemplate: "${key}: ${val} (${count})",
So ${key} is the key of the grouped column.
${val} is the current value of the grouped column.
${count} is the number of rows for the current group.
Thus, you can template only the ${val} and ${count} variables because you will be aligning the summary under the grouped column's header cell (making ${key} rather irrelevant).
Hope this is enough to get you a under way with the template.
Cheers,
Borislav
Thank you!
Your reply is very helpfull.
I have another question. If I want to template a summed column, Which Value should be write into template. Could you give me a short code snap?
Thanks!
I see ... so you wish to have a sort of a table row with cells filled in only if a certain column is grouped.
In my opinion, that would require a good template for the option I mentioned earlier (groupedRowTextTemplate ) and you will be all set.
Here are the instructions for jQuery Templating that which you can use to achieve the desired result:
http://api.jquery.com/tmpl/
Hope this helps.
Hi Borislav.
Thanks for you reply.
I have reloaded the images.