Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by JAY on Aug 18, 2009 17:00
open dhtmlx forum
window onClose event

I am using pro version.
I want to process some actions while closing the window and also want to close the window once I am done
So I am creating a model window and attaching onClose event to it with the handler.
My handler seems to work fine but doesn't close the window.

Below is my code snippet. Please help

var dhxWins= new dhtmlXWindows();
var winId = "searchWin";

function search(partyId)
{
dhxWins.createWindow(winId, winLeft, winTop, 1025, 550);
dhxWins.window(winId).setText("Address Search");
dhxWins.window(winId).denyResize();
dhxWins.window(winId).button("park").disable();
dhxWins.window(winId).center();
dhxWins.window(winId).setModal(true);
dhxWins.window(winId).attachURL("search.do?partyId="+partyId);

function closeParent(win)
{
    alert("closing"+win.getText());
// action 1...
// action 2...
win.close();
}




Answer posted by Alex (support) on Aug 19, 2009 04:51

Please, check that onClose event returns true. Handler should return true to confirm operation (in the other case it will be denied).

dhxWins.attachEvent("onClose",function(win){

...

return true

})

Answer posted by JAY on Aug 19, 2009 06:48
Thanks. Works perfect.