Grid - Reordering within a multi-column block.

1 Answer 24 Views
Grid
Peter
Top achievements
Rank 1
Iron
Peter asked on 06 Dec 2024, 02:27 PM

We using 2024.1.319.

I set up an example here: https://dojo.telerik.com/xVuefKEn.   I actually want to try and prevent reordering within a multi-column columns.   Normal columns I can prevent easily.   

Unfortunately, it appears as though the new and old indexes are not clear.   Sometimes they are the same but the column moves anyway.   If I manually try to reorder it back to the oldindex, that doesn't work.

It is like the old and new indexes are incorrect in this situation.

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 11 Dec 2024, 09:17 AM

Hi Peter,

You can use the approach described in the following KB:

- https://docs.telerik.com/kendo-ui/knowledge-base/grid-prevent-columns-reordering

Here you will find the modified Dojo example using multicolumn headers: https://dojo.telerik.com/LISiYuOl 

In addition, there is a feature request for built-in singular column reordering and I recommend casting your vote for it:

https://feedback.telerik.com/kendo-jquery-ui/1667040-singular-column-reorder-functionality

Please let me know if you have any questions.

Regards,
Neli
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.

Peter
Top achievements
Rank 1
Iron
commented on 11 Dec 2024, 10:31 AM

Unfortunately, the dojo, you updated, doesn't prevent the column dragging for the child columns of a multi-column. 

The debugger statements don't appear to work in dojo, so I used console.logs but it presents the same confusion over the new/old indexes of child columns.

That feature request is mine.  Thanks.

Neli
Telerik team
commented on 16 Dec 2024, 06:10 AM

Hi Peter,

You can use the same approach and check if the currently reordered column exists in the columns array, if not you can search for it in the nested columns (columns[i].columns). Here you will find the modified example: https://dojo.telerik.com/XasylJFW. You can use the example and extend the logic accoridng the the requirements of the project.  

Regards, Neli

Peter
Top achievements
Rank 1
Iron
commented on 16 Dec 2024, 01:36 PM | edited

Thanks that variation helped and solves my issue.
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Iron
Answers by
Neli
Telerik team
Share this question
or