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

Using groupHeaderTemplate and rowTemplate in same Grid

2 Answers 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 05 Apr 2013, 03:14 PM
I have a Grid linked to a remote dataSource that's using a rowTemplate.

I've now configured the dataSource to group by a particular column and also set the column definition to hidden for the grouped field. Finally, in the rowTemplate, the particular <td> for the grouped field has display: none applied.

This all works -- the column for the grouped field is not displayed and it all looks fine.

However, I don't seam to be able to use a groupHeaderTemplate for the hidden column, so my internal field name is displayed in the group header. I've tried simply using: groupHeaderTemplate: '#= value #' in the column definition but it seems to be ignored.

I have another Grid which is essentially the same, but doesn't use a rowTemplate. This allows me to specify a groupHeaderTemplate for the hidden column.

How is it possible to combine a custom rowTemplate and a groupHeaderTemplate?

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 09 Apr 2013, 12:18 PM
Hello,

It should be possible to use the groupHeaderTemplate for a hidden column when using custom rowtemplate. I have created a small jsBin example that demonstrates this scenario. Let me know if I am missing something.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
M
Top achievements
Rank 1
answered on 11 Apr 2013, 02:33 PM
Ahhh... found the problem.

I was defining the groupHeaderTemplate on a different field to the one that was grouped. If it hadn't worked at all I would have found the problem sooner -- it's just that it was 'almost' working as expected.

You can see what I mean if you change the first column definition in the jsBin you created to { field: "LastName"..}  insead of { field: "FirstName"... }: it doesn't break - it just doesn't use the groupHeaderTemplate.

Thanks for your help.
Tags
Grid
Asked by
M
Top achievements
Rank 1
Answers by
Daniel
Telerik team
M
Top achievements
Rank 1
Share this question
or