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

207
Vistas
Multiple Row Edit Functionality in React

I am trying to implement an edit row functionality in a react grid. I have attached 2 links. Link 1 is the GIF which shows the functionality that I have implemented using the below code.(For privacy reasons I cannot publish the actual code)

Link 2 is the functionality I am trying to achieve! How shall I do that?

 return (
  <>
    <p>Sample Row Field</p>
    {editId === Id && editRow === true ? (
      <select options={options} handleChange={handleChange} />
    ) : (
      existingRowValue
    )}
  </>
);

Link 1 - The Functionality I have (Individual Row)

https://i.stack.imgur.com/JJEL5.gif

Link 2 - The Functionality I want (Multiple Rows)

https://i.stack.imgur.com/w7ppb.gif

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I'd assume editId is a local state variable, same for editRow So what you'd need to do is change editId into a state called editIds as an array (because you want to edit multiple rows, not just one), and replace editId === Id with editIds.includes(Id)

  • onEditClick: should add the rowId into this state, like setEditIds(...editIds, rowId)
  • onSave/CancelClick: should remove the id from the state, like: setEditIds(editIds.filter((id) => id !== rowId))
about 4 years ago · Juan Pablo Isaza Denunciar

0

I think following code sample will give you an idea of how you can achieve this when you move your editId to a local component state.

https://codesandbox.io/embed/hardcore-sid-pythne?fontsize=14&hidenavigation=1&theme=dark

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