I would like to know how to set the group header template which displays data after calculating from multiple column values. The formula is something like sum(col_x_value * col_y_value) / sum of col_x_value after grouping. This data should display for each and every grouped header.
Looking forward towards your reply.
Thanks in advance.
4 Answers, 1 is accepted
You can execute a function inside the template. Please see the following example:
http://dojo.telerik.com/AHUzO
Regards,
Kiril Nikolov
Telerik by Progress
Hi,
In http://dojo.telerik.com/AHUzO only "age" value is getting passed to the foo function. How can I pass other column values to it?.
Please find the code snippet here
I want to display Percentage : Sum ( item1 values in that group * item2 values in that group ) / sum ( item1 values in that group )
For example, the first group should display Percentage : 27.5
( (21 * 28) + (21 * 27) ) / (21 + 21) = 1155 / 42 = 27.5
Thanks.
Hi,
In http://dojo.telerik.com/AHUzO only age field value is getting passed to the foo function. How to pass other column values to it?
Please find the code snippet here.
I want to display Percentage value in each group header.
Example:
Percentage : Sum ( item1 values in that group * item2 values in that group ) / sum ( item1 values in that group )
For the first group: ( ( 21 * 28 ) + ( 21 * 27 ) ) / ( 21 + 21 ) = 1155 / 42 = 27.5
So, first group header should display Percentage : 27.5
Also, please let me know if I can set group header template globally.
Thanks
In the function you can just get a reference to the dataSource and get all the aggregates using the aggregates method documented here:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource
Regards,
Kiril Nikolov
Telerik by Progress