我有一个5000毫秒超时的ajax TreeStore,并且当查询执行时间超过超时时,我想捕获该事件。我该怎么做?ExtJS当查询执行时间超过超时时捕获事件
我TreeStore:
Ext.define('Portal.store.ObjectsTreeStore', {
extend: 'Ext.data.TreeStore',
model: 'Portal.model.ObjectsTreeModel',
proxy: {
type: 'ajax',
url: 'my/url.json',
timeout: 5000, // 5 seconds
reader: {
type: 'json',
successProperty: 'success',
messageProperty: 'message'
}
},
listeners: {
beforeload: function() {
console.log('1');
},
load: function() {
console.log('2');
},
exception: function() {
console.log('3');
}
}
});
有了这个代码超过了查询执行时间,并要求取消的时候我只赶上beforeload
事件。当一切正常时,我抓到beforeload
和load
。
谢谢,在你的例子中所有的作品,因为我的期望,但我不能让它在我的代码工作。我试图更深入地检查我的代码。 –