MUIDataTable I want to hide checkbox but also i want row data when i click on rows

5.1k Views Asked by At

i am doing this but onRowClick is not working

<MUIDataTable
        data={tableData}
        columns={tableCols}
        options={{
          search: true,
          fixedHeader: true,
          selectableRows: 'none',
          selectableRowsOnClick: true,
          displayRowCheckbox:false,
          onRowClick:this.getRow,
          customToolbarSelect: () => {},
        }}
      />

is there any option to hide check also and geting row data also

2

There are 2 best solutions below

0
On

Try adding this:-

selectableRows: "multiple",
selectableRowsHideCheckboxes: true,
selectableRowsOnClick: true,
0
On

You can hide this if you pass selectableRows: false in options props. for more details follow the documentation.

<MUIDataTable
  title={"Employee List"}
  data={data}
  columns={columns}
  options={{
    selectableRows: false // <===== will turn off checkboxes in rows
  }}
/>