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

474
Vistas
DataGrid MUI - How to delete selected row on icon button click

How do I delete the selected row from my table, I do understand the concept is that to remove the row from the array.

    const columns = [
  {field: 'ticketno', headerName: 'Ticket No', flex:1},
  {field: 'event', headerName: 'Event Type', flex:1},
  {field: 'area', headerName: 'Area', flex:1},
  {field: 'created_date', headerName: 'Date Created', flex:1},
  {field: 'status', headerName: 'Status', flex:1},
  {field: 'action', headerName: 'Action', flex:1,
    renderCell: () => {
      return [
        <IconButton>
          <Delete style={{color:'gray'}}/>
        </IconButton>
      ]
    }}
]

let rows = []
for (var x = 0; x<tabledata.length; x++) {
  rows.push({
    id:x,
    ticketno:tabledata[x].TKT_NO,
    event:tabledata[x].EVT_ID,
    area:tabledata[x].ZNAME,
    created_date:tabledata[x].CRT_DATE,
    status:tabledata[x].STATUS_DESC,
  })
}

              <Box sx={{height: 550, width: '100%'}}>
                <DataGrid 
                rows = {rows}
                pageSize={10} rowsPerPageOptions={[10]}
                checkboxSelection disableSelectionOnClick
                components= {{Toolbar: GridToolbar }} 
                componentsProps={{toolbar: {showQuickFilter: true,
                quickFilterProps: {debounceMS: 500}}}}
                columns = {columns}/>
              </Box>

I have attached an image below, upon clicking onto the delete icon, it should remove the row from view. An example

about 4 years ago · Juan Pablo Isaza
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