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();
}
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
})
Thanks. Works perfect.