ExtJs

2013-10-24 6 views
10

में अजाक्स अनुरोध समय समाप्ति बढ़ाना क्या अजाक्स अनुरोध टाइमआउट बढ़ाने के लिए ExtJs लाइब्रेरी में एक एकल कॉन्फ़िगरेशन है?ExtJs

मैं दो विन्यास निम्नलिखित की कोशिश की है लेकिन न तो मदद की:

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 }); 

अद्यतन:

ऐसा लगता है कि अब आपको एक्स्टजेस 5+ के लिए setTimeout() का उपयोग करके Ext.Ajax टाइमआउट सेट करने की आवश्यकता है, बस सेटिंग के बजाय संपत्ति:

Ext.Ajax.setTimeout(60000); 
+0

ऐसा लगता है कि यह काम कर रहा है। धन्यवाद। – Kabeer

+0

समय सीमा के बारे में क्या? मैं एक मार्ग गणना पर काम कर रहा हूं और मुझे लगता है कि इसे खत्म करने में बहुत कुछ लगेगा ... –

3

मैं था एक नीचे करने के लिए:

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 कॉल (फॉर्म सबमिशन के बारे में नहीं पता) बदल देगा।