I have a button that appears on each row of my Matrix. When I click the button I want one of the attributes of the entity I clicked on to be updated to a new value.
It seems like when I click the button, the selected element does not get updated to the one clicked until after the click event. So the wrong entity’s attribute keeps getting updated.
I need: click button on the entity in the Matrix I want updated. 1) selected element should FIRST be updated to the one I just clicked. 2) function runs and updates the attribute of the entity whose button i just clicked.
What I get is:
- Click button on the target entity in the Matrix.
- the previously selected entity is captured and sent to the function to be updated
- the correct entity then becomes the selected entity after the onclick function has been executed.
Can I do something about this?
Thx. for any direction.