This is a migrated thread and some comments may be shown as answers.

How to access a field's title in grid's groupheadertemplate

1 Answer 260 Views
Grid
This is a migrated thread and some comments may be shown as answers.
anusha
Top achievements
Rank 1
anusha asked on 30 Jul 2015, 05:22 PM

What I am looking for is this:

Assuming I have a column defenition like this and I do grouping by drag and drop:

 columns: [{
field: "productField",

title: "Product Title", ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

 

aggregates: [

"count"],],

 

groupHeaderTemplate:

"#= title #:#= value # Count(#= count #)"

 

}]

 

 

 

 How do I get the header to look like like "Product Title: This is a product title Count(5)"? I keep getting title undefined. I am able to access the field but not title for that field.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 03 Aug 2015, 07:24 AM
Hi,

All fields available in the groupHeaderTemplate are listed in this documentation article:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.groupHeaderTemplate

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,
Radoslav
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
anusha
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or