Unplanned
Last Updated: 28 Jul 2022 10:43 by ADMIN
Juan
Created on: 21 Jul 2022 18:34
Category: Grid
Type: Feature Request
0
Prevent columnReorder event to be called for specific columns

I realize this has been covered by this workaround in the past, but the need to write extra code for moving the column back to the original position makes this seem a bit "hacky" and most importantly, the user experience of being allowed to drag the column in the first place just to see it jump back seems wrong.

The good news is that the kendoGrid already has a mechanism for preventing the columnReorder event from getting fired in the first place! The bad news is that it only happens for columns that have either of these 2 classes ["k-group-cell, "k-hierarchy-cell"]

My request is to have a configuration option that enforces that same behavior for specific columns as:

1. Add a "reorderable" flag to be set as part of the column configuration (set it to false for those we want to keep in place)

2. This flag will set a class on those columns the same way it works for columns with "k-group-cell" or "k-hierarchy-cell" classes, so the event can be prevented.

There is one important caveat to consider with this approach: Only columns at the front and the back of the grid can be locked in place, so there needs to be validation to prevent having non-reorderable columns among reorderable ones.

 

 

0 comments