gregnb / gregnb/mui-datatables

how to remove or make checkbox color transperent if isRowSelectable value false in MuiDataTable

Open
#2,006 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

i would like to remove or make checkbox invisible on screen when isRowSelectable false
i have researched and tried so much but im unable to achieve this outcome with MuiDataTable

is there any way that we can remove or make checkbox color transperent when row is desable

here is my state data for datatable

```
const data = [
{
isSelected: true,
name: "Jhon",
title: "leader",
location: "house",
isDisabled: true
},
{
isSelected: false,
name: "don",
title: "ruler",
location: "on table",
isDisabled: false
},
```
and here are my options

i have tried mutiple ways its not working for me

with MuiTheme

```
const getMuiTheme = () =>
createTheme({
overrides: {
MUIDataTableSelectCell: {
desabled: {
color: "yellow !important"
}
}
}
});
```
with table options

```
CheckboxProps: {
style: {
color: "blue" // Change this to the desired checkbox color
}
},
```
here is the condition for making desabled row

`isRowSelectable: (dataIndex) => !stateData[dataIndex].isDisabled,`

im able to gray out the desabled row

```
setRowProps: (row, index) => {
const rowProps = {};
if (stateData[index].isDisabled) {
rowProps.style = {
backgroundColor: "lightGray"
};
}

console.log(rowProps);
return rowProps;
}
```
but how can i do to checkbox as well

here is my sandcode box
https://codesandbox.io/s/serverless-glade-2bzlg7

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.