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

Does the Kendo UI Grid support Column Header Templates?

8 Answers 1225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 13 Jun 2012, 07:28 PM
I've been reading through the documentation and I've been unable to find a definitive answer on this.

Does the Kendo UI grid support column header templates?

We need to put a custom totals div into column headers on certain columns so we can update them on the fly as the data changes.

8 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 14 Jun 2012, 08:26 AM
Hi Michael,

I am afraid that this feature is not supported out of the box at present, but we will appreciate if you could submit the idea at KendoUI user voice forum. Thus way the community would be able to vote for and evaluate it, if the feature request turns out to be popular we will consider its implementation for one of our future releases.

At the moment as a workaround you could try to modify the corresponding html elements with custom code.
$(".k-grid-header-wrap th") //returns grid header cells


All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jojo
Top achievements
Rank 1
answered on 08 Sep 2012, 09:19 PM
"template" for column values and "headerTemplate" for the header of the column seems to do the trick
0
poet_byron
Top achievements
Rank 1
answered on 26 Sep 2012, 05:24 PM
Thanks Michael!  I have confirmed that the headerTemplate does work.  Kendo team, the documentation for the kendo ui grid configuration column options should be updated to include this option, unless the headerTemplate is supposed to be deprecated.  Again, thanks Mike.
0
Jojo
Top achievements
Rank 1
answered on 26 Sep 2012, 08:47 PM
I am not Michael, but you are welcome anyways... like you, I only found that "headerTemplate" option within the forums, so yeah, I hope the Kendo team would really update the documentations and make it a priority.

That would probably save them a lot of time, since most of the questions here in the forums could have been answered/solved if there was proper/complete documentation.
0
Tahir Ahmad
Top achievements
Rank 1
answered on 24 Oct 2012, 11:04 AM
Is it available now? Or is there a way to change CSS Class and text-alignment.
0
Dimo
Telerik team
answered on 29 Oct 2012, 02:43 PM
Hello,

The headerTemplate setting will be documented shortly. Its usage is identical to the one of the template property.

In order to set a custom CSS class or other attributes to the Grid (header) cells, one can use attributes and headerAttributes:

$("#grid").kendoGrid({
    columns: [
        {
            field: "Price",
            attributes: {
                "class": "myClass",
                style: "text-align: right"
            }
        }
    ]
});


Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Todd
Top achievements
Rank 1
answered on 31 Oct 2012, 04:29 AM
Thanks for finally adding this to the API doc.  While you're taking missing API documentation requests, what about grid columns.values (values property for foreignkey feature), and the requestEnd event of the data-source (just to name a few) ??

Thanks.
0
charan
Top achievements
Rank 1
answered on 14 Nov 2012, 05:47 AM
hi,
I have to display column names dynamically.In my controller I am getting my names and I want to display those names in my columns of my grid.can you help me how to do this?
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Jojo
Top achievements
Rank 1
poet_byron
Top achievements
Rank 1
Tahir Ahmad
Top achievements
Rank 1
Dimo
Telerik team
Todd
Top achievements
Rank 1
charan
Top achievements
Rank 1
Share this question
or