This is what I wrote in the pop-up window.
CopyCodeThe Code is as follows: $ ('# A'). Click (function () {// click the event
$ ('# W'). Window ({// window Initialization
Title: 'random point', width: 400, height: 300, iconcls: 'icon _ add ',
// Important part
Onbeforeclose: function () {// event triggered before the panel is closed
If (confirm ('the window is closed. Make sure that your current operation is saved. \ N continue to close the window? ')){
$ ('# W'). Window ('close', true); // call the close method here. True indicates that the onbeforeclose callback function is ignored when the Panel is closed.
} Else
Return false;
}
});
});
In this case, the confirm window pops up when you click the red X or cancel | close button. Click OK to close the window and click Cancel to retain the window.
If you do not want to bring up a prompt, you can directly call: $ ('# W'). Window ('close', true)