0

I use jQuery UI to show a dialog, but I don't know how to call a function if dialog is closed by user. This is the code:

    function Configure_Popup() {
        $("#dialog").dialog({
            autoOpen: false,
            show: {
                effect: "blind",
                duration: 100
            },
            hide: {
                effect: "blind",
                duration: 100
            }
        });

        $(".opener").click(function () {
            $("#dialog").dialog("open");
        });
    }

How can I do that please?

victorf
  • 978
  • 2
  • 17
  • 35
Dev pro
  • 620
  • 1
  • 7
  • 12

1 Answers1

2

You should use the close event:

$("#dialog").dialog({
    autoOpen: false,
    show: {
        effect: "blind",
        duration: 100
    },
    hide: {
        effect: "blind",
        duration: 100
    },
    close: function() {
        console.log("User closed the dialog");
        // Call your function here
    }
});
DontVoteMeDown
  • 21,122
  • 10
  • 69
  • 105