Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!