Detect dirty records

I showed a prototype of a Radzen built application today which they loved! One suggestion they asked for was to detect if a record is dirty so they can be prompted if navigating away from a modified record.

Is this possible? And if not would it be something that could be added as a feature request?


1 Like

I would like to know about that for Angular too.

What is "navigating away from a modified record"?

Obviously if someone types in the address bar and navigates to a new page we can't control that.

However, if a user is modifying a record or creating a new one, and they click a link within the application it would be nice to be able to give a warning that changes will be lost unless they save.

An example off the top of my head is Facebook. If you start to create a Facebook status and click a link within Facebook it tells you that you'll lose the unposted status.

Hope that makes sense.

Not sure how to handle all click events in a Blazor application from a single place. Also one can't prevent navigation from a bubbling DOM event in Blazor. Has to all be done from JavaScript. All in all it reminds me of onbeforeunload which is a horrible way to do that. Frankly speaking I don't think this feature can be implemented in such a global and invasive way.

Probably one can handle the Then event of the edit dialog and display some notification if the record hasn't been saved. The dialog result can be used for that.

1 Like