Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
How to add curson style "not-allowed" to Material UI datagrid disabled row?

I've a conditional disabled row in material ui data grid where user cannot select or perform actions on it. I want to show cursor: "not-allowed" on this row. How can we add styling to that row? As we don't have any parameter in rows specifying that it's a disabled row.

      <DataGrid
        rowHeight={75}
        components={{
          NoRowsOverlay: CustomNoRowsOverlay,
        }}
        onSelectionModelChange={currentlySelected}
        selectionModel={[...selected]}
        columns={columns}
        rows={rows}
        autoHeight
        disableSelectionOnClick={disableSelectionOnClick}
        {...props}
        checkboxSelection={role === ROLES.ADMIN}
        disableColumnMenu
        isRowSelectable={(params) =>
          !(params?.row?.id === currentUserID)
        }
      />

and This is what disabled row and normal row look like in browser inspect element. First one is disabled row here. enter image description here

CSS implementation for root class, in which the datagrid is wrapped.

root: {
  '& .MuiDataGrid-columnsContainer': {
    backgroundColor: theme.palette.secondary.main,
    color: theme.palette.text.light,
    lineHeight: '62px !important',
    maxHeight: '62px !important',
    minHeight: '62px !important',

    '& .MuiCheckbox-root': {
      color: theme.palette.checkbox.secondary,
    },
  },
  '& .MuiDataGrid-cell, & .MuiDataGrid-columnHeader': {
    outline: 'none !important',
  },
  '& .MuiDataGrid-window': {
    backgroundColor: colors.bgColor.secondary,
  },
  '& .MuiDataGrid-columnSeparator': { display: 'none' },
  '
  '& .MuiCheckbox-root': {
    color: theme.palette.checkbox.main,
  },
  '& .MuiDataGrid-sortIcon': {
    color: theme.palette.iconColor.default,
  },
  '& .MuiCheckbox-colorPrimary.Mui-disabled': {
    color: 'rgba(0, 0, 0, 0.26)',
  },
},
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Apply your own custom css styles and import it to your component :

import './custom.css'
.MuiCheckbox-colorPrimary.Mui-disabled {
  cursor: not-allowed !important;
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda