0
$('#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);
    });

我收到脏表单的默认弹出窗口。

4

1 回答 1

0

Dirty Forms 1.x watches the top document (when hosted within a frame) by default. You can disable this functionality by calling ignoreParentDocs() (which is incorrectly named, it should be ignoreTopDocument() to reflect what it actually does).

$.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.

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.

于 2015-07-28T13:39:04.047 回答