【问题标题】:Abort an ext js grid store ajax call中止 ext js 网格存储 ajax 调用
【发布时间】:2016-04-13 07:00:16
【问题描述】:

我需要中止 EXT JS store 加载(这是一个使用 ajax 调用的网格面板存储)。

我正在使用 Ext JS 3.4

我尝试了以下方法。

Ext.Ajax.abort(store.proxy.activeRequest);
delete store.proxy.activeRequest;

【问题讨论】:

  • 以上代码的结果是什么?有什么错误或警告吗?
  • 我收到类似“错误:TypeError:this.activeRequest is undefined”的错误
  • 您使用的是哪种商店代理?请发布您的 store 和 ajax 请求代码,如果您可以为它创建 fiddle.sencha.com/#home,那就太好了。
  • 确实在最新文档中我找不到 activeRequest 参数:docs.sencha.com/extjs/6.0.2-classic/Ext.data.proxy.Proxy.html

标签: javascript ajax extjs extjs3


【解决方案1】:

这可以通过给出一个条件来解决,

var activeRequest = store.proxy.activeRequest;

if (typeof activeRequest.read != 'undefined') 
{ 
    Ext.Ajax.abort(activeRequest.read); 
}

【讨论】:

    猜你喜欢
    • 2023-03-10
    • 2012-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多