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

Sorting a grid column when using a template for cell data

1 Answer 551 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 12 Mar 2014, 06:19 PM
I have a kendo grid with filterable set to true.  I have a column that use a template to combine multiple data values and display them as one in the cell. On example of this is.

{
    title:"Customer Name",
    template:"#:customer.firstName# #:customer.lastName#",
    width:105
}

However, this column looses it's ability to be filterable.  another example is where i'm use a template where the data for the cell template is three booleans, if they are true it displays the text, if not it displays nothing. 

Any help with this would be greatly appreciated!

-Brandon

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 14 Mar 2014, 11:45 AM
Hello Brandon,

Basically you should bind the column to a particular field in order to make it sortable.

http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.field

Please notice that when a column is bound you can still display whatever you like inside the template, however sorting/filtering/grouping will work over that field which you specified in the column definition.

Kind Regards,
Petur Subev
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
Brandon
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or