I'm using MUI X Data Grid (Material-UI) and trying to position the checkbox selection column in the middle of my grid. Currently, even though I define the checkbox column in my column definitions array at the desired position, it always appears as the first column.
Here's my current implementation:
// Table component
<ExDataGrid
columns={columnsTable3pl}
checkboxSelection
hideFooter
rows={productsWarehouse || []}
loading={isPending || isPendingNotes}
/>
// Column definitions
export const columnsTable3pl: GridColDef[] = [
{
field: 'notes',
headerName: 'Note',
// ... other props
},
{ ...BrandColumn },
{ ...ProductNameColumn },
{
field: 'asin',
headerName: 'ASIN',
// ... other props
},
{
field: 'quantity',
headerName: 'Total Quantity',
// ... other props
},
{
...GRID_CHECKBOX_SELECTION_COL_DEF,
headerClassName: 'bg-expander-light text-white',
renderHeader: () => '',
headerAlign: 'center',
align: 'center',
},
// ... other columns
];
- Positioning the
GRID_CHECKBOX_SELECTION_COL_DEFin the middle of my columns array.
Environment:
- "@mui/x-data-grid-premium": "latest version"
- React
- TypeScript
