Table change cell event needs to fire after the cell is actually changed

I'm currently trying to create a small javascript function to recalculate the total cost for a row in a table whenever any cell in that row is changed. However, I'm not able to do this because the table's change cell event fires whenever the cell is clicked and not when the change has actually been made.

So my script runs before I can even make a change to the table which means the total isn't actually updated.

I think this needs to be changed so that the event fires after the user clicks away or presses Enter, essentially after the cell returns to it's "normal" state. This way, the change precedes the events as you would expect with the name of the event.

Hi @hegemonyCricket, Thanks for the question!

If you're using the Table component you can add a new column with a computed Value, such as adding all of your values up with {{currentSourceRow.column1Name + currentSourceRow.column2Name}}

You can trigger code to run when a Cell changes by using the Change cell event handler.

Your query that runs on Cell Change should then update your Resource for that field then trigger a refresh of the data

Possibly a .clearChangeset() to reset the state of your table.
image

Let me know if that doesn't work!

Dan K
Retool TAM