Darshana
Darshana

Reputation: 621

How to enable/disable multiple rows delete button of Material Ui data table

Using Material UI datatable which has everything searching , pagination and multiple rows delete option. Refer from https://openbase.com/js/mui-datatables/documentation (cannot copy paste sample code from client machine)

I need to restrict delete button access based on delete permission user has,

I am new to React and Material UI, need suggestion on how to enable/disable delete button shown up when we select multiple rows.

Upvotes: 1

Views: 1066

Answers (2)

abdulalim
abdulalim

Reputation: 480

For enable/disable row select

const options = {
       selectableRows: "none",
       // selectableRows: "single",
       // selectableRows: 'multiple',
      }

For row delete /hide /remove icon from top

customToolbarSelect: () => {},

Upvotes: 0

Darshana
Darshana

Reputation: 621

Got example from material ui code it self which help me to have control on delete icon in header when user selects multiple rows.

https://github.com/gregnb/mui-datatables/blob/master/examples/customize-toolbarselect/CustomToolbarSelect.js

Upvotes: 1

Related Questions