How to disable warning before leaving the detail view form with unsaved changes

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
mcvaidas
Posts: 29
Joined: 2019-04-14 17:45

How to disable warning before leaving the detail view form with unsaved changes

Post by mcvaidas » 2025-01-29 21:50

Hello, I don’t need this new feature in 24.19 (Warning users before leaving the detail view form with unsaved changes using beforeunload event.
) in my POS project. Is it possible to disable it for a specific detail view?

mcvaidas
Posts: 29
Joined: 2019-04-14 17:45

Re: How to disable warning before leaving the detail view form with unsaved changes

Post by mcvaidas » 2025-02-07 10:42

this is my solution (i added window.onbeforeunload = null;):

var dv = AppGiniHelper.DV;
var actionbuttons = dv.actionbuttons;
var group = actionbuttons.addGroup("", "", "highlight");
group.addButton(
"Tischplan",
function () {
window.onbeforeunload = null;
location.href = "tablemap.php";
},
Variation.Info,
""
);

Post Reply