I've a JET view which has two plugins: UrlParam and UnloadGuard. The app is using the HashRouter. The issue is that when I click the browsers' back button the parameter is directly removed before it even hits the UnloadGuard.
The UnloadGuard is implemented as follows (in the init method):
this.use(plugins.UnloadGuard, args => {
const form = this.$$("frm");
if (form.isVisible() && form.isDirty()) {
return webix
.confirm({
title: "Form is incomplete",
text: "Do you still want to leave?"
})
}
return true;
});
this.use(plugins.UrlParam, ["id", "canvasEntityId"]);
Example: The URL looks like '.../task/1'. After I click the browsers' back button the url looks like '.../task' and not awaits the UnloadGuard (as I expect).
How can I work around this? Any help is highly appreciated because I need this ASAP (as always...).
Thanks,
Martin
I've a JET view which has two plugins: UrlParam and UnloadGuard. The app is using the HashRouter. The issue is that when I click the browsers' back button the parameter is directly removed before it even hits the UnloadGuard.
The UnloadGuard is implemented as follows (in the init method):
Example: The URL looks like '.../task/1'. After I click the browsers' back button the url looks like '.../task' and not awaits the UnloadGuard (as I expect).
How can I work around this? Any help is highly appreciated because I need this ASAP (as always...).
Thanks,
Martin