How to persist the column classes in a treelist when hiding columns

1 Answer 97 Views
TreeList
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Lee asked on 30 Mar 2023, 02:38 PM | edited on 30 Mar 2023, 04:12 PM

I have a kendo treelist and need to include a column menu to show or hide columns. My column headers have classes applied to them on initialization via the headerAttributes option. After hiding a column, the remaining columns' headers lose their classes. This is duplicated in the attached dojo. Notice last name is in blue. When you hide first name using the 3 dot menu, Last Name turns black. I have tried the same thing with a kendoGrid and it works as expected. Something is off with the TreeList. How do I fix this? Note that while my example here uses text color, using a template won't solve my real issue as I need the class applied to the header cell itself so I can center the content and other stuff. 

https://dojo.telerik.com/ALeLiZUV

In troubleshooting, I noticed that grid.columns is not returning headerAttributes.class for the treelist when calling $("#myGrid).data("kendoTreeList").columns for the tree list but it is when calling $("myGrid).data("kendoGrid").columns for the grid. I'm attaching images from my own project of the two returns (Note that they are from different instances which is why the other data is not the same in the two screenshots nor do they go with the dojo.)

1 Answer, 1 is accepted

Sort by
1
Accepted
Martin
Telerik team
answered on 04 Apr 2023, 09:07 AM

Hello, Lee,

The behaviour is a known bug which can be found in our Feedback Portal. I will raise its priority a bit so that it will move up in our bug fixing queue. 

You can consider the modified example as a temporary workaround.

Let me know if you have any further questions.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
commented on 04 Apr 2023, 02:04 PM

Thanks. This fixed the issue.
Tags
TreeList
Asked by
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Answers by
Martin
Telerik team
Share this question
or