Window event onClose

When using event OnClose then occurs before the window is closed but if simple alert(‘win close’); is working and occurs alert window but not closing ???

and more when that OnClose uses script to update tree or grid or something else it always repeat !!! then stunt

How it work ???

dhxWins.attachEvent(“onClose”, function(win){
// code here
});

onClose event handler should return true to confirm closing:

dhxWins.attachEvent(“onClose”, function(win){
// code here
return true;
});

have solution i replaced onclose event hide window

But if you simply hide window, it still harvest memory.
If you do not plan to show it again - better close it.

thanks…

YES you right !!!

and when using load windows throw ajax, data in window is loosing … but window is hide ???

To hide a window (not to close/remove it):

dhxWins.attachEvent(“onClose”, function(win){
win.hide();
return true;
});

To show the window you need to call show() method.

	parent.dhxWins2.attachEvent("onClose", function(oc){
		var openWindows = parseFloat(parent.document.getElementById('openWindows').value);
		parent.document.getElementById('openWindows').value = openWindows - 1;
		return true;
    });

I have tried this so many ways, it simply does not work. The text box value decreases by 1 as the code says, then i return a true value which should close the window right? WRONG.

I have tried to put the close function in there, nothing. If i put just return true in there, it will close, but if there is any other code, it will execute the code and stop, the window will not close.

oc = the createWindow() function

We need a complete demo to recreate the problem.