Skip to content

Using drag and drop on all the column and not only on the drag icon ? #272

Answered by KevinVandy
CamachoPt asked this question in Q&A
Discussion options

You must be logged in to vote

You can hide the the drag handles with enableColumnDragging={false} even if enableColumnOrdering is true.

It is possible to make a whole column draggable, but you will need to hook up all of the drag events yourself in muiTableHeadCellProps and/or muiTableBodyCellProps. Might not be as hard as you think.

You can take these two MRT source files for the drag handle icon buttons as inspiration:

https://github.com/KevinVandy/material-react-table/blob/main/packages/material-react-table/src/head/MRT_TableHeadCellGrabHandle.tsx

https://github.com/KevinVandy/material-react-table/blob/main/packages/material-react-table/src/buttons/MRT_GrabHandleButton.tsx

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CamachoPt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants