Kendo Grid sort icon missing when header text get wrap

1 Answer 116 Views
Grid Sortable
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Benjamin asked on 22 Jun 2022, 01:00 AM

When I try to change the header text to wrap instead of showing ellipsis when it is too long. the sort icon seems to be missing. refer to the image below. what I would like to have is for the sorting icon to be top aligned, beside the word business

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Denchev
Telerik team
answered on 24 Jun 2022, 09:58 AM

Hi, Benjamin,

I've prepared a Dojo example with a wrapped text header, you can examine it here:

https://dojo.telerik.com/@gdenchev/IwonaWEh 

CSS

      .k-grid  .k-grid-header  .k-header .k-column-title {
        white-space: normal;
      }

The icon seems to be rendering normally:

You can position it at the top instead of the center by using the following rule:

      .k-grid  .k-grid-header  .k-header .k-i-sort-asc-sm {
        place-self: flex-start;
      }

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 27 Jun 2022, 01:37 AM

hi,

I saw from ur dojo that the k-link for ur column header is <span>. while mine is <a>, not sure if it is due to this?

Georgi Denchev
Telerik team
commented on 29 Jun 2022, 09:45 AM

Hi, Benjamin,

I am guessing that an older version of Kendo UI is being used and that is why the structure of the elements is different.

In this case, you can use an absolute position for the icon and then you can manually align it:

      .k-grid  .k-grid-header  .k-header {
        white-space: normal;
      }

      .k-grid-header .k-header.k-sorted > .k-link > .k-icon.k-i-sort-asc-sm,
      .k-grid-header .k-header.k-sorted > .k-link > .k-icon.k-i-sort-desc-sm {
        position: absolute;
        top: 50%;
        right: 5px;
      }

Dojo

https://dojo.telerik.com/@gdenchev/upubaqUt 

Best Regards,

Georgi

Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 01 Jul 2022, 08:31 AM

I have created a dojo to replicate my issue and the k-link being <a> when using version 2022.2.510
Georgi Denchev
Telerik team
commented on 05 Jul 2022, 11:54 AM

Hello, Benjamin,

The provided Dojo example seems to have a lot of customizations and overriding of kendo styles so we cannot provide much support there. If the widget appearance/functionality breaks due to something on our end, we can provide assistance and potential workarounds.

However, if the cause is a custom implementation/solution, it is up to the developer to find a solution to the issue.

I've modified the Dojo and left only the styles for the text wrapping.

https://dojo.telerik.com/@gdenchev/azOdAgix 

Just as an advice, the style that seems to be affecting the icon's appearance is the following one:

      #grid-container .k-grid-header .k-header * {
        height: 100% !important
      }

However, I would still strongly advise against making such drastic changes to the kendo styles.

Best Regards,

Georgi

Tags
Grid Sortable
Asked by
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Georgi Denchev
Telerik team
Share this question
or