2013-10-24 10 views
10

ExtJsライブラリにAjaxリクエストタイムアウトを増やすための単一の設定がありますか?ExtJsでAjaxリクエストタイムアウトを増やす

私は二つの構成以下試してみましたが、どちらも助け:

Ext.override(Ext.data.Connection, { 
    timeout: 60000 
}); 

Ext.Ajax.timeout = 60000; 

答えて

22

私はあなたが言及した2を使用するだけでなく、これら上書きする必要がありました:ExtJSの5のための

Ext.override(Ext.data.proxy.Ajax, { timeout: 60000 }); 
Ext.override(Ext.form.action.Action, { timeout: 60 }); 

更新:

ちょうど設定するのではなく、ExtJS 5+にsetTimeout()を使用してExt.Ajaxタイムアウトを設定する必要があるようですプロパティ:

Ext.Ajax.setTimeout(60000); 
+0

これは動作しているようです。ありがとうございました。 – Kabeer

+0

期限はどうですか?私はルート計算に取り組んでいます。私はそれが完了するために多くを要すると思います... –

3

は、私は1つ下にしなければならなかった:

Ext.Ajax.timeout= 60000; 
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 }); 
0

私は、これは(4.2.3でテスト)ExtJSの4のための最高の変更であることがわかりました。

// Connection uses its own timeout value hardcoded in ExtJS - we remove it so that Ext.data.Connection will then 
// fallback to using Ext.Ajax.timeout, thus giving a single place for setting the timeout 
// Bonus: you can change this at runtime 
Ext.define('Monitoring.overrides.Connection', { 
    override: 'Ext.data.Connection', 
    constructor: function() { 
    delete this.timeout; 
    this.callParent(arguments); 
    } 
}); 
Ext.define('Monitoring.overrides.ProxyServer', { 
    override: 'Ext.data.proxy.Server', 
    constructor: function() { 
    delete this.timeout; 
    this.callParent(arguments); 
    } 
}); 

Ext.Ajax.timeoutを使用すると、すべてのAJAX呼び出しが変更されます(フォームの送信についてはわかりません)。

関連する問題