-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XGrid] Disable reordering on a specific column #1161
Comments
Hi, @efreethy thanks for raising this. When we were working on the column reorder feature we were considering that case. Our argument of not adding it was that even if you make one column not reorderable you could still reorder the columns around it which will indirectly move your non-reordarable column so it won't truly be non-reorderable. I'm interested to hear your thoughts on this? |
thanks for the quick response @DanailH I imagine a non-reorderable column as essentially a pinned column. When such a column is involved as a subject in a reorder - its ordinal position is not allowed to change, therefore the ordinal positions of all the other columns would rotate around it. |
@DanailH We should be cautious here. There are two different concepts:
AG Grid illustrates the two different notions well. |
As far as I understand the pain:
/**
* If `true`, the column cannot be dragged for reordering.
*/
disableReorder?: boolean; Its name matches the name of the global flag:
/**
* If `true`, the position of the column is locked. Reordering can't change it.
*/
lockPosition?: boolean; This would both impact the header dragging feature and the column selector reorder: #839. I was hoping that none of these two options would be necessary with a controllable pattern (developers handling the reorder callback and keeping the previous state) but unfortunately, only 2 could be implemented this way, combined with 1. |
@efreethy Out of curiosity, why? |
First off: great work with this product.
I have a custom checkbox column - I am not using the checkbox built ins. This column should not be reorderable, however there is no ColDef option to specify that. The other areas of column functionality are optional (resizable, sortable, etc). It makes sense to also have a "reorderable" col def option.
The text was updated successfully, but these errors were encountered: