Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set the header of a grid using templates? #41

Closed
forumma opened this issue Jan 10, 2013 · 6 comments
Closed

Is it possible to set the header of a grid using templates? #41

forumma opened this issue Jan 10, 2013 · 6 comments

Comments

@forumma
Copy link

forumma commented Jan 10, 2013

Hey,

I'm using the kendoGrid binder to create my grid and i'm using the rowTemplate. The result is the grid without header. I want to know if it's possible to define the header of this grid?

Thanks alot

@rniemeyer
Copy link
Member

Currently the header does not use KO templates. However, you can do something like:

<div data-bind="kendoGrid: { data: items, rowTemplate: 'rowTmpl', altRowTemplate: 'altTmpl', 
  useKOTemplates: true, columns: [{headerTemplate: 'a'},{headerTemplate: 'b'},{headerTemplate: 'c'}]}">
 </div>

Here is a sample: http://jsfiddle.net/rniemeyer/MWLre/

Does that work for you?

@forumma
Copy link
Author

forumma commented Jan 11, 2013

Thanks a lot that's work perfectly.

@forumma
Copy link
Author

forumma commented Jan 17, 2013

The only problem I now have with the headerTemplate is I can't use the sortable and the groupable function on my Grid. Do you know a workaround for this?

Thanks

@rniemeyer
Copy link
Member

Looks like you just need to make sure that you specify which field that each column pertains to, so like:

columns: [{ field: 'id', headerTemplate: 'a'},{field: 'name', headerTemplate: 'b'},{headerTemplate: 'c'}]

Sample: http://jsfiddle.net/rniemeyer/Gngxf/

@Marmotor
Copy link

Hello,

Regarding this issue, there is one small problem : the sorting will not work on observable items. So if I get my info through $.getJSON from a server-side controller action, the data mapped in the kendo grid will not be sorted, even though the column header has the small arrow attached to it. Is there a way around it?

Thanks,
Marmotor

@abhi901abhi
Copy link

How to set Row Header in Kendo UI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants