简体   繁体   English

脏表单 - 如何忽略脏表单在parent.window.location.href上弹出

[英]Dirty form - how to ignore dirty form pop up on parent.window.location.href

$('#js_eligibilty_discard').on('click',
    function(e) {
        $.DirtyForms.choiceContinue = true;

        $("#test").dialog('close');
        $("#js-ErrorPopup").dialog('close');

        $('body').dialogPartialLoader('Processing');

        $.ajax({
                type: "POST",
                url: GlobalVars['app_url'] + "/web/xyz/cancel?xyz=${param.xyz}",

                cache: false,
                success: function(data) {
                    parent.window.location.href = GlobalVars["app_url"] + "/individual/findPlans"

                },
                error: function(data) {
                    $('body').dialogClose();
                    alert(data.statusText);
                }
            });

        return false;

        $.DirtyForms.choiceCommit(e);
    });

I am getting default pop up of dirty form. 我正在默认弹出脏表格。

Dirty Forms 1.x watches the top document (when hosted within a frame) by default. Dirty Forms 1.x默认情况下监视顶层文档(在框架内托管时)。 You can disable this functionality by calling ignoreParentDocs() (which is incorrectly named, it should be ignoreTopDocument() to reflect what it actually does). 您可以通过调用ignoreParentDocs()(命名错误,应该使用ignoreTopDocument()来反映它实际执行的操作)来禁用此功能。

$.DirtyForms.ignoreParentDocs();

Dirty Forms 2.x no longer watches the top document by default, but you can customize event binding to change which frames are watched and which target frame to redirect if the user decides to proceed. 默认情况下,Dirty Forms 2.x不再监视顶级文档,但您可以自定义事件绑定以更改要监视的帧以及在用户决定继续时重定向的目标帧。

Also, $.DirtyForms.choiceContinue and $.DirtyForms.choiceCommit() can only be called from within a dialog module (after fire() is called) for them to have any effect, but it is unclear from your question if that is what you are doing. 此外, $.DirtyForms.choiceContinue$.DirtyForms.choiceCommit()只能在对话框模块中调用(在调用fire()之后)才能使它们产生任何效果,但是从你的问题中不清楚这是什么你在干嘛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM