If you want to enable both dndSource and row dragging simultaneously, you can achieve this by utilizing the rowDragEntireRow
feature. This will hide the row dragging button and allow you to drag the entire row by clicking anywhere on it.
In your column definition, make sure to configure dndSource
and set rowDragEntireRow
to true on the grid.
<AgGridReact
ref={rightGridRef}
onGridReady={(event) => {
setRightGridReady(true)
event.api.sizeColumnsToFit()
}}
rowDragManaged={true}
rowDragEntireRow={true}
columnDefs={[
{headerName: "", dndSource: true, width: 30, suppressMenu: true},
{headerName: "Pivot By", field: 'name', suppressMenu: true}
]}
rowData={selected.map((item) => {return {name: item}})}
getRowNodeId={(data) => data.name}
/>
For more information on Entire Row Dragging, visit https://www.ag-grid.com/react-data-grid/row-dragging/