dhtmlxWindow 2.6 problems with modal windows

Hi,

I have a form that opens two modal windows. The first one when validating the form content and the second if there is any errors on the data validation to show a message to the user.

This works fine with dhtmlxWindow 2.5, but now it doesn’t work.

I try to simplify the source to identify the problem but I couldn’t fine the mistake on my code, maybe its a problem with 2.6 or now I have to do it in another way.

I attach a demo file with the issue.
windows.html.zip (1.57 KB)

Hi,

the reproduced the issue in IE. It could be solved by the offset variable check:

if(offset) myCWin.setPosition(pos[0],pos[1]+offset);

The offset validation solves the problem in IE but stills remain on Firefox and Safari.

I debugged the code and I found that getPosition() returns a negative value the second time that is executed.

Try to call new window creation with a timeout:

function fChangeWindow() { myCongressWindows.window("dialogWaiting").close(); aParams = new Array("Warning", '<ul style="text-align: left;"><li>2nd modal window</li></ul><br>'); window.setTimeout(function(){ fmyCongressWindowsOpen("dialogWindow", 100, 100, 500, 250, aParams); },1); }

Thanks Alexandra,

The second window now is opened, but it is positioned at de begin of the document if you have scroll.
windows.html.zip (1.56 KB)

Hi,

I have problems with modal windows in 2.6 too.

  1. The modal window cannot be centered. (bug also present in 2.5).
  2. Buttons minimize, maximize, close don’t work. And if I try to close the window using parent.dhxWins.window(“my_window”) .close() an error occurs.

I solved the second problem by going back to 2.5 for now, because I really need my modals to close.

Do you have any solution for any of this?

The second window now is opened, but it is positioned at de begin of the document if you have scroll.

You may try to use the following to get offset:

var offset =(document.body.scrollTop?document.body.scrollTop:(window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop));

I have problems with modal windows in 2.6 too.

Both problems are not reproduced locally. Could you provide the sample ?

Hi Alexandra,

I change the following line, that I previously use to calculate offset:

var offset =(document.body.scrollTop?document.body.scrollTop:window.pageYOffset);

with the new one that you sugested with no results on FF

var offset =(document.body.scrollTop?document.body.scrollTop:(window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop));

The second windows is moving to the top.

Hi,

we have reproduced the problem. After closing window the page scrolls to the top.

Try to use the following workaround to solve the problem:

[code]function fChangeWindow() {
var topOffset = (window.pageYOffset?window.pageYOffset:0);

myCongressWindows.window("dialogWaiting").close();
			
aParams = new Array("Warning", '<ul style="text-align: left;"><li>2nd modal window</li></ul><br>');

window.setTimeout(function(){
	if(topOffset) window.scroll(0,topOffset);
	fmyCongressWindowsOpen("dialogWindow", 100, 100, 500, 250, aParams);
},1);

}[/code]