Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SrinivasChary066 opened this issue Jun 1, 2023 · 0 comments

Comments

@SrinivasChary066
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant