Material-table: Prevent column reordering

Created on 24 Jun 2019  路  6Comments  路  Source: mbrn/material-table

Any way to prevent the user from moving the columns around?

enhancement help wanted wontfix

Most helpful comment

@xiaomaini Please do implement this as it is not always desirable to have some columns be draggable.

All 6 comments

I checked the code the other day, and there doesn't seem to be one. It should be fairly simple to implement.

There is a react-beautiful-dnd component that is inserted into each header cell. With an additional parameter in props.options, this could be changed to use a simple div

Thanks, I will take a look later and create a PR if there is no objections to adding such a feature.

I thought being able to drag the columns was a feature. I find it cool.

I also like the feature. But I think it can get in the way of some functionality and custom components. IMO, it would therefore be appropriate to make it optional, or ideally opt-out.

In my use case I am rendering a second row in the header with controls that control some column properties, and am using a fixed layout with computed widths. Moving columns around in that scenario is not pretty.

@xiaomaini Please do implement this as it is not always desirable to have some columns be draggable.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

victorwvieira picture victorwvieira  路  3Comments

behrouz-s picture behrouz-s  路  3Comments

jlgreene2 picture jlgreene2  路  3Comments

revskill10 picture revskill10  路  3Comments

Mihier-Roy picture Mihier-Roy  路  3Comments