jQuery 在 Apex Oracle 版本中调用模态页面

jQuery to call on modal page in Apex Oracle verison

有人可以在 Apex Oracle 中帮助 jquery 吗?当对页面进行了文本或更改并且用户在保存之前尝试导航离开时,我想调用 Apex 中的模式页面。

它类似于此处的 onbeforeunload,除了我希望它在我创建的模态页面上调用而不是使用 Window 的 window。

$(document).ready(function() {
  formmodified=0;
    $('form *').change(function(){
        formmodified=1;
    });
  window.onbeforeunload = confirmExit;
    function confirmExit() {
      if (formmodified == 1) {
          return "New information not saved. Do you wish to leave the page?";
      }
  }
});

在Oracle Apex 中有两种关闭模态对话框的方法,关闭和取消。在关闭对话框之前,您总是可以 运行 进行一些验证,例如用户必须接受未保存的更改将会丢失。

您可能想要覆盖 ondialogclose javascript 事件。 Here is an example of how to override the dialog onclose event.。把关闭前需要执行的逻辑放在那里即可。