I am Working with Material-Table . I need to select multiple rows on clicking a button based on some condition .the condition is written inside the code below. Can anyone guide me on how to select multiple rows based on some condition?
<MaterialTable
icons={tableIcons}title=""
columns={[
{ title: 'Project Name', field: 'Project_Name', render: rowData => <Link to='/projectdetails'>{rowData.Project_Name}</Link> },
{ title: 'Methods Covered', field: 'Methods_Covered', type: 'numeric' },
{ title: 'Methods not Covered', field: 'Methods_not_Covered', type: 'numeric' },
{ title: 'Total Methods', field: 'Total_Methods', type: 'numeric' },
]}
data={this.state.results}
components={{
Toolbar: props => (
<div>
<MTableToolbar {...props} />
<div className="Mtable">
<div>
<Button color="primary" onClick={rowData =>
(rowData.Methods_Covered ?
rowData.tableData.checked = true :
rowData.tableData.checked = false)}>
select Highlighted</Button>
</div>
</div>
</div>
),
}}
onSelectionChange={this.handleSelect}
onRowClick={this.handleRowClick}
options={{
sorting: true,
selection: true,
search: true,
searchAutoFocus: true,
searchFieldAlignment: 'right',
searchFieldStyle: {
border: 'solid black 2px',
},
}}
/>