Question

I've problem with store load. Extjs cancel load after 30 seconds. Is there some parameters or something else to increase store load time?

Here is example of store:

  var store = Ext.create('Ext.data.Store', {
        model : 'store_model',
        proxy : {
            type : 'ajax',
            url : 'data/backend.php',              
            reader: {
                type: 'json',
                root: 'data'
            },
            writer: {
                type: 'json'
            }

        },          
        autoLoad : true
    });
Était-ce utile?

La solution

See here: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.Ajax

Ext.Ajax.timeout = 60000;

Autres conseils

store is a declaration for the calls for the ApiServer that links a model view, to a server model data access.

First you have to define wich of the methods linked to a call you will use the types are "uxproxy", "ajax", "html"

when you use them, you can set a linked call timeout to the current,

you have to call by using callback :

function(response, success ){
}

but what really happens is that when you call

store.load(elemn, {callback:function(contractId,success) {              
    if (success) {
        ...
    }
})

this call by the moment of the code execution, reads a property loaded to the DOM that change it timesout to 30000 ms

so.. you have to override the property. the code posted before doesn´t work if you don't do this

Ext.override(Ext.data.proxy.Ajax, { timeout: 600000 });

(this will override de default property thats close your call)

Ext.override(Ext.form.action.Action, { timeout: 600 });

hope this help!

This allows to change the timeout only for one store:

store.proxy.setTimeout(60000);

Tested in ExtJs 6.2

The topic is too old but FYI who want to do the quicky trick.

The default of Ajax call in Sencha is 30000 milliseconds (30 seconds) So, you have to set a config to the default behavior in the Ext.data.proxy.Ajax, for example, 60s, like:

Ext.define('Core.data.proxy.WrapperAjax',{
    extend: 'Ext.data.proxy.Ajax',
    alias: 'proxy.wrapperAjax',
    config: {
        timeout: 60000
    }
    ...
});

or overwrite in Ext.data.Store proxy like:

Ext.define('MyApp.store.MyStore', {
    extend: 'Ext.data.Store',
    proxy: {
        ...
        timeout: 60000, 
        ...
    },
});
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top