I am trying to add a button inside my material ui datagrid row.
My datagrid component
<DataGrid
rows={adminStorage}
columns={columns}
autoPageSize
getRowId={(logistics) => logistics._id }
autoHeight
headerHeight={60}
pageSize={100}
className={classes.root}
/>
the column
{
...
field: "update",
align:"left",
headerAlign: "left",
headerName: "Update",
renderCell: (cellValues) => {
return (
<Button pL={2} onClick={updateHandler} variant="contained" color="primary">
update
</Button>
)
}
},
the update handler
const updateHandler = (cellvalues) => {
console.log("The data botained fron the handler is", cellvalues)
}
I want it to work in such a way that when the button is clicked it links to another page that has edit form as well as getting that specific row object and its id
What should i do?