Prevent changing rows on a table and open popup warning

Trying to do something on the GUI I don’t even know is possible, and I wanted to ping the forums to get anyone else’s opinion. I have a perspective screen that has a table on it. A user selects a row on the table and enters data elsewhere on the screen. Once they enter the data they want, they hit a ‘save’ button which pushes those changes to a database. I wanted to add a feature that if the user selects a new row while they have unsaved changes on a previously selected row, to throw a warning popup that prevents the row selection change which wipes out all the data entered from the previous row.

I tried experimenting, but I couldn’t find any sort of event action that I could grab for this. There are events for when the row changes, but that is after the row selection has occurred and my change scripts/bindings trigger which wipe out the “unsaved” changes.

Thanks for any help with this.

That would be an unusual and confusing user interface.
A more standard way would be to open a modal popup on row click, passing the rowdata and the database row ID and work from there.
Once the modal popup is open the user can't select another row without closing the popup.

3 Likes

I would experiment with disabling the table entirely when editing begins elsewhere.

I've done exactly this, so you can definitely set it up this way with some custom props to hold editing state, etc.

I think Transistor's idea sounds like a much better and simple solution.

1 Like