You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually i'm rendering a button in a body cell using CELL property and enabled on row click event too, but when clicking on a button, button click event is getting called and on row click event is getting called, I need to disable on particular column row cell on row click, please do the need full .
Im using this
muiTableBodyRowProps={({ row }) => ({
//add onClick to row to select upon clicking anywhere in the row
onClick: row.getToggleSelectedHandler(),
sx: { cursor: 'pointer' },
})}
I have used to prevent on row click on particular cell
const columns = [
{
accessorKey: 'username',
header: 'Username',
muiTableBodyCellProps: ({ cell }) => ({
onClick: (e) => {
e.stopPropagation()
},
}),
//or in the component override callbacks like this
Cell: ({ cell }) => {
return
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Actually i'm rendering a button in a body cell using CELL property and enabled on row click event too, but when clicking on a button, button click event is getting called and on row click event is getting called, I need to disable on particular column row cell on row click, please do the need full .
Im using this
muiTableBodyRowProps={({ row }) => ({
//add onClick to row to select upon clicking anywhere in the row
onClick: row.getToggleSelectedHandler(),
sx: { cursor: 'pointer' },
})}
I have used to prevent on row click on particular cell
const columns = [
{
accessorKey: 'username',
header: 'Username',
muiTableBodyCellProps: ({ cell }) => ({
onClick: (e) => {
e.stopPropagation()
},
}),
//or in the component override callbacks like this
Cell: ({ cell }) => {
return
},
},
];
is this right way
Beta Was this translation helpful? Give feedback.
All reactions