PDA

View Full Version : [CLOSED] Timeout



RCN
Jan 22, 2015, 1:43 PM
On version 2.x i was able to control timeout by doing the following:


Ext.Ajax.timeout = 600000;
Ext.override(Ext.form.Basic, { timeout: Ext.Ajax.timeout / 1000 });
Ext.override(Ext.data.proxy.Server, { timeout: Ext.Ajax.timeout });
Ext.override(Ext.data.Connection, { timeout: Ext.Ajax.timeout });

Reference thread: http://forums.ext.net/showthread.php?24778-CLOSED-How-can-i-set-the-timeout-to-a-store-in-a-user-control

But on version 3.1, it does not work anymore. At this time i can set ResourceManager's AjaxTimeout or set it globally by setting ajaxTimeout on web.config (http://examples3.ext.net/#/Getting_Started/Introduction/Overview/)

I wonder whether there were changes on Ext.form.Basic, Ext.data.proxy.Server or Ext.data.Connection timeouts.

In my opinion, it should be added to breaking changes.



<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<script type="text/javascript">
Ext.Ajax.timeout = 600000;
Ext.override(Ext.form.Basic, { timeout: Ext.Ajax.timeout / 1000 });
Ext.override(Ext.data.proxy.Server, { timeout: Ext.Ajax.timeout });
Ext.override(Ext.data.Connection, { timeout: Ext.Ajax.timeout });

var Click = function () {
Ext.net.DirectMethod.request({
url: Ext.net.ResourceMgr.resolveUrl("~/Example/Action"),
success: function (result) {
Ext.Msg.alert('Information', 'Success');
},
failure: function (result) {
Ext.Msg.alert('Information', 'Failure');
}
});
}
</script>
</head>
<body>
<ext:ResourceManager runat="server" ScriptMode="Debug" />
<ext:Button Text="Click Me" runat="server">
<Listeners>
<Click Handler="Click();" />
</Listeners>
</ext:Button>
</body>
</html>




namespace SandBox.Controllers
{
public class ExampleController : System.Web.Mvc.Controller
{
public ActionResult Index()
{
return View();
}

public AjaxResult Action()
{
System.Threading.Thread.Sleep(TimeSpan.FromMinutes (2));

return new AjaxResult
{
Success = true
};
}
}
}


Thanks in advance

Daniil
Jan 22, 2015, 2:16 PM
Hi Raphael,

It is how a ResourceManager's AjaxTimeout works:

Ext.data.Connection.prototype.timeout = t;
Ext.Ajax.setTimeout(t);
Ext.net.DirectEvent.setTimeout(t);
Ext.data.proxy.Server.prototype.timeout = t;

Does it suit your needs?

RCN
Jan 22, 2015, 3:02 PM
Hi Raphael,

It is how a ResourceManager's AjaxTimeout works:


Ext.data.Connection.prototype.timeout = t;
Ext.Ajax.setTimeout(t);
Ext.net.DirectEvent.setTimeout(t);
Ext.data.proxy.Server.prototype.timeout = t;

Does it suite your needs?

Yes.

How about Ext.form.Basic.Timeout?

Daniil
Jan 23, 2015, 9:25 AM
Your code appears to be working for me.

Ext.override(Ext.form.Basic, {
timeout: 1
});

RCN
Jan 23, 2015, 12:21 PM
I reviewed and everything seems to be ok.

Please mark this thread as closed.