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

[Solved] Identify non-sortable columns

1 Answer 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 19 Jan 2015, 09:44 PM
We have several grids that have some non-sortable columns and we would like to identify which columns are sortable with some type of visual indicator.

Is there an accepted way to do this. I was thinking of maybe using a sort icon for the sortable columns, is this supported out of the box or do I need to figure out something clever with jquery?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 21 Jan 2015, 03:57 PM
Hi Marc,

There are two easy ways to identify sortable columns client-side (in case you need to do this on the fly client-side):

+ via the columns collection (field) of the Grid object
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#fields-columns

+ sortable columns have their title rendered in a a.k-link element, while non-sortable columns render the column title directly in the <th> element

As for adding some sort of indication for the user, there is no widely accepted or recommended way to do that, but the easiest thing you can do is apply custom styling to the a.k-link element (e.g. text color, bold font, even add pseudo elements, etc). jQuery trickery and DOM manipulation after Grid initialization (or on dataBound, if needed) is always possible, of course.

Regards,
Dimo
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
Marc
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or