Data table: inline edit – save/cancel on other action?

I'm working on a data table and each line is editable.

Editable data table

It's obvious what happens if you click on update or cancel, but what should happen if the editable row is out of view (click on another page of pagination, edit another entry, sort table, switch to a completely another page on the website)?

As the data is crucial the data shouldn't automatically saved (and changes happen not very often).

a) Show a confirm dialog on every click outside of the editable row? b) Show a confirm dialog on every action which would get the row out of sight? c) Discard changes automatically (don't like that as the user might expect a save) d) ... ?