Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

291
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda