PDA

View Full Version : Ext Window autoLoad



udaysasi
3 Mar 2010, 10:18 PM
Hello everyone,

I am new to ExtJS so please bear with me. I did go over the documentation and forums before posting this question.

I have a link on my page, clicking on which should display a modal popup window with some content that is loaded from an Ajax call. I saw that Window object has an autoload option to load the content as soon as the window is rendered. So I used the following code to create the window in my JS function.


function myFunction() {
var winHeight = 200;
var winWidth = 400;
var winTitle = 'Results';
var winToolbarText = 'Reload';
var winUrl = './goform/cm_action_popup?cm=abc';

//winUrl = 'dummy.txt'; //Use this to test
var resultsWindow = new Ext.Window({
id:'resultsWindow',
width: winWidth,
height: winHeight,
autoScroll:true,
//closeAction: 'hide',
title: winTitle,
autoLoad:{url:winUrl,timeout:20000},
expandOnShow: true,
modal: true,
plain: true,
renderTo: document.body,
tbar:['->',{
text:winToolbarText,
handler:function() {
resultsWindow.load(resultsWindow.autoLoad.url);
}
}],
listeners:{show:function() {
this.loadMask = new Ext.LoadMask(this.body, {
msg:'Loading. Please wait...'
});
}}
});
resultsWindow.show();
}


Here is the problem I am facing.. I tried to track the URL in Firebug and I see that I get a response in 10.2 seconds all the time. But, the "Loading, Please wait..." message does not go away until exactly 60 seconds from the time window is opened. After 60 seconds, the message goes away and the response is painted on the window. I timed this so many times changing the timeout value above, but everytime I see an "exact 60 sec" delay. If the response from server is obtained in 13 seconds, it takes an additional 47 seconds before the mask message is dismissed.

Two more things :
(1) If I omit the timeout option, I get a response in 10.2 seconds, the status in Firebug shows as "200 OK", but I see a blank after 60 seconds instead of the response and in the Firebug, I notice the status changes from "200 OK" to "200 Aborted" under the XHR requests tab.
(2) If I use the "dummy.txt" url (which is commented above) which returns very fast(as it has a couple of lines of dummy text), everything works fine, no 60 seconds lock on the window.

Since it is always 60 seconds, I am assuming there is some setting I am missing here. Any help would be greatly appreciated.

Thanks in advance,
-Uday