mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

Allow option to prevent toolbar select from displaying

Open mattgbrich opened this issue 7 years ago • 1 comments

It would be really nice to allow us to pass a flag to prevent this toolbar from appearing.

I need to enable row selection, but I don't want that toolbar to appear, and I don't want users to be able to delete rows.

It looks like it's currently just hardcoded to always appear if selectedRows.data.length

{selectedRows.data.length ? (
          <TableToolbarSelect

I can eliminate the delete action/icon with customToolbarSelect, but then I still get an empty toolbar covering up the main toolbar (which I want users to still have access to after making a selection).

It seems like it would be a common use case to want row selection without having that toolbar pop up.

mattgbrich avatar Jun 21 '19 15:06 mattgbrich

Marking as a duplicate of https://github.com/gregnb/mui-datatables/issues/451, as a similar issue was raised there, and there's already a bit of conversation around it. The short story is that there is currently no plan to disable the select toolbar, and this alone won't do what you're hoping anyway, as the regular toolbar isn't "select-aware."

Instead, I think it should be possible to add any options you want through the custom toolbar, thereby recreating the options you see fit to have available, and choosing the behavior you want.

gabrielliwerant avatar Jun 21 '19 18:06 gabrielliwerant