I'm wondering if there is a way to de-select all rows after clicking a Material UI action, which calls a function to do so. I'm wondering if there is a way to de-select all rows after clicking a Material UI action, which calls a function to do so.
Here is a basic example of what i'm trying to achieve, mostly from the Material-UI-Table page.
function ActionsOnSelectedRows() {
const deselectAllRows () => {
// Deselect all rows
}
return (
<MaterialTable
title="Actions On Selected Rows Preview"
columns={[
{ title: 'Name', field: 'name' },
{ title: 'Surname', field: 'surname' }
]}
data={[
{ name: 'Mehmet', surname: 'Baran' },
{ name: 'Zerya Betül', surname: 'Baran' }
]}
options={{
selection: true
}}
actions={[
{
tooltip: 'Remove All Selected Users',
icon: 'delete',
onClick: () => deselectAllRows()
}
]}
/>
)
}