Repository navigation
Replies: 1 comment
|
Yes, in MRT v3 you can combine You can retain the built-in nonzero-selection message and its clear-selection button, supplying your own text only for the zero case: import Box from '@mui/material/Box';
import { useMaterialReactTable } from 'material-react-table';
const table = useMaterialReactTable({
columns,
data,
enableRowSelection: true,
positionToolbarAlertBanner: 'top',
state: {
// Merge any other controlled table state here too.
showAlertBanner: true,
},
renderToolbarAlertBannerContent: ({
table,
selectedAlert,
groupedAlert,
}) => (
<Box sx={{ px: 2, py: 1 }}>
{selectedAlert ?? (
<span>
0 of {table.options.rowCount ?? table.getCoreRowModel().rows.length}
{' row(s) selected'}
</span>
)}
{groupedAlert}
</Box>
),
});The v3 banner source only constructs With server-side/manual pagination, supply The two customization points are documented in the toolbar customization guide. I checked the source and documented options; I have not run this against your app. |
Uh oh!
There was an error while loading. Please reload this page.
I have a workflow with tables build around row selection, so I'm thinking that always having the X of Y row(s) selected banner render would be useful. Unfortunately I'm not having a lot of luck figuring out how to do this, if it's feasiable. Is it possible for me to do this, or should I try to explore alternatives?
All reactions