problem with dhtmlxAjax and dhtmlxWindow

Hi!

I have a dhtmlxLayout with attached toolbar. On toolbar which loading from XML i have a button and when press on it a dhtmlxWindow appear. I attached statusbar to my window and arragned 2 buttons: “OK” and “Cancel” to it. On click “OK” i call php-scenario with postSync of dhtmlxAjax and close my window. In FF when i press the “OK” button window will close and php-scenario begin to work. But in IE and Chrome when i press this button window doesn’t close and it will close after my php scenario finishes.
I use dhtmlxlayout progressOn to mark the start of working my php-scenario, and progressOff to mark the end of working.

How could i solve this problem?

Hi,

if you send a synchronous request, other functionality will be called after the response it is received.

Check the attached sample.
layout.zip (42.8 KB)

Hello!

I try to continue work after response gets but the problem problem still remains…
Look please the attachement.
test.rar (458 KB)

Hello,

To solve the problem you need either send asynchronous request or use 1 ms timeout:

function func() { WinPPAlertHide(); window.setTimeout(function(){ ps = dhtmlxAjax.postSync("Pt.php","&e="+new Date().getTime()); ps.getXMLTopNode("r");var rs = ps.doXPath("/r/rc"); var arr = rs[0].firstChild.nodeValue.split(";"); if (arr.length>0) { for (var i=0; i<arr.length; i++) { (function(e){ СЃT(arr[e],e+1,arr.length, 1) })(i); } } PPG.clearAll(); PPG.loadXML("gll.php"); },1); }

I tried using function setTimeout. in FF everything work correctly, but in IE and Chrome result dissapointed me. Are there other ways to solve this problem?

Locally timeout resolved the problem with window closing - the window is closed right after the OK button clicked. I’ve attached the modified dhtmlx.js
index.zip (1.53 KB)

Alexandra, did you attach correct file?

Sorry I meant index.js …

But I didn’t find any differences between old index.js and modified index.js :frowning:

we have set the 1ms timeout in func() Try to use this file in your demo. Locally it has solved the problem with window closing

Yes, function setTimeout help me to close the confirm window, but how can i see the running process with changing windows or another indication? in other words how can user understand that his browser is still working?