1

is it possible to send value to parent where popup windows closed using close window button?

i'm already looking here and i already try it, but it's seem i must click button in popup not close button to send some value.

and i already try it like this, where check popup close or not using timer, and work but i will use this if i dont have another option

Community
  • 1
  • 1
Pentolan
  • 161
  • 11

1 Answers1

0

From the link you gave, I assume that it's fine to use jQuery.

An alternative way is to use JqueryUI Dialog. Every widget in jQueryUI has events to listen to so you can customize as you wish.
The event you want to customize is beforeClose.

My example code: https://jsfiddle.net/sygq1awu/

js

$(function() {
      $("#dialog").dialog({
        beforeClose: function(event, ui) {
          if (confirm("close?")) {
            $("body").css("background-color", "yellow");
          } else {
            return false;
          }
        }
      });
    });

html

<div id="dialog" title="Basic dialog">
  <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
Jimmy
  • 1,276
  • 7
  • 8
  • so you create JqueryUI Dialog to call function? it's like you create button to call function too right? – Pentolan Dec 28 '16 at 04:08