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

Kendo UI Grid issue: 'k-sort' class added to the wrong column

1 Answer 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jan Herman
Top achievements
Rank 1
Jan Herman asked on 16 Aug 2017, 07:04 AM

We are running into a (I think) simple issue with Kendo UI Grid.

Situation is best explained using an image (see attached).

My grid has 4 columns: ID, External Code, Manufacturer,Type.
When I sort, everything works fine, no issues.

When we hide the "External Code"-column (the second column) the table reloads and all is well. 

Now, when we sort on the NEW second column (Manufacturer) the following happens:
1. [Correct] The grid is sorted properly
2. [Correct] The Manufacturer table header gets the 'k-sorted' class, making it blue, showing an arrow 
3. [Issue] The k-sorted class is added to the wrong <col> in the table body <colgroup> definition.

In this case it's adding k-sorted to the third column - which is the original position of the manufacturer column.

Is this a bug in kendo, or are we doing it wrong™?

Additional info

- We're using the latest kendo javascript library.
- We're hiding/showing columns using the $("#grid").data("kendoGrid").hideColumn("internalColumnName") API

 

Please advise,

1 Answer, 1 is accepted

Sort by
1
Jan Herman
Top achievements
Rank 1
answered on 16 Aug 2017, 12:12 PM

After contact with support we found this was an actual bug.

Follow https://github.com/telerik/kendo-theme-default/issues/676 for updates on the bugfix.

This topic can be closed.

Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
commented on 13 Aug 2024, 09:58 PM | edited

This seems to still be an issue in the latest release if the column sorted on is hidden, the last column in the grid gets the class. I also noticed that sorting a column does not apply the k-sort class to the correct column: https://dojo.telerik.com/@dojolee/eFIbaSUn

I made a bug report here: https://feedback.telerik.com/kendo-jquery-ui/1661405-k-sorted-applied-to-wrong-column

Georgi Denchev
Telerik team
commented on 15 Aug 2024, 01:43 PM

Hello, Lee,

I've approved the feedback item and I also opened a GitHub issue about it.

https://github.com/telerik/kendo-ui-core/issues/7942 

Thank you for the provided report.

Best Regards,

Georgi

Tags
Grid
Asked by
Jan Herman
Top achievements
Rank 1
Answers by
Jan Herman
Top achievements
Rank 1
Share this question
or