Is it possible to build a group header template that displays information from multiple fields? I tried various approaches but cannot get it to work. For example, I defined a new column with a template that includes multiple fields, but it is not shown when grouping by it unless I provide a field value that exists in the data source. Even then the template is not used for the group header. I can see the logic of this, but I can't find another way.
6 Answers, 1 is accepted
All fields available in the groupHeaderTemplate are listed in the documentation:
The fields which can be used in the template are:
- value - the current group value
- average - the value of the "average" aggregate (if specified)
- count - the value of the "count" aggregate (if specified)
- max - the value of the "max" aggregate (if specified)
- min - the value of the "min" aggregate (if specified)
- sum - the value of the "sum" aggregate (if specified)
You cannot use fields which aren't in this list. Regards,
the Telerik team
Yes, I did already review the documentation and I should have pointed that out in my original post. That is why I described one attempt of specifying the template on the column to include multiple fields. I also tried adding a calculated field in the data source model, but that produced an empty field.
To explain this better, my data source includes two fields that I would like to combine together into a single grid column that I will then group on.
I expect this can be done, but I cannot find the right syntax to accomplish it.
Thanks for your help.
It should be possible to implement grouping by a computed field like this: http://jsbin.com/ubifok/2/edit
However you still won't be able to access more than the current group value in the group header template.
the Telerik team
This was EXACTLY what I needed. I wish I could give you rep or something. Thank you!
Is it possible to use aggregate outside grid ?
like in the Mobile Custom Templates (http://demos.telerik.com/kendo-ui/mobile-listview/templates)
I want to put more information in the header like how many items in that group.
your help is much appreciate.