Home > other >  How to update a value based on previous value in an array of objects?
How to update a value based on previous value in an array of objects?

Time:02-07

I am trying to update every current value based on the previous value of another property.
Actually, I need to do the task with dates, but just to keep it simple, I'll explain my problem with simple numbers. I have

  1. Start, which is 1.
  2. Stop, which is already defined
  3. End
  4. Duration, which is already defined

My goal

  • Start = Duration of previous index End of previous index
  • End = Start Stop of current value

To illustrate, I added the screenshot of the table, how it should look like.
Desired view

enter image description here

Current View

enter image description here

Code below and Expected table results

I have forked your sandbox to create a proof-of-concept example:

Edit ag-grid (forked)

  •  Tags:  
  • Related