Using drag and drop on all the column and not only on the drag icon ? #272
-
I am struggling to understand how to do this. Is it possible to remove the drag and drop icon and use all the column as draggable ? |
Beta Was this translation helpful? Give feedback.
Answered by
KevinVandy
Dec 20, 2022
Replies: 1 comment
-
You can hide the the drag handles with It is possible to make a whole column draggable, but you will need to hook up all of the drag events yourself in You can take these two MRT source files for the drag handle icon buttons as inspiration: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
CamachoPt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can hide the the drag handles with
enableColumnDragging={false}
even ifenableColumnOrdering
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/ormuiTableBodyCellProps
. 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