Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AJAX调用期间和之后的事件注册(用于加载远程存储) 假设“load”在1毫秒后启动,并且计算机在2毫秒后注册的第一个侦听器。是否会调用someFunctionB 假设在800毫秒后触发“load”,计算机在2毫秒后注册第一个侦听器,在3毫秒后注册第二个侦听器。是否会为这两个索引调用someFunctionB_Javascript_Ajax_Extjs_Event Handling_Dom Events - Fatal编程技术网

Javascript AJAX调用期间和之后的事件注册(用于加载远程存储) 假设“load”在1毫秒后启动,并且计算机在2毫秒后注册的第一个侦听器。是否会调用someFunctionB 假设在800毫秒后触发“load”,计算机在2毫秒后注册第一个侦听器,在3毫秒后注册第二个侦听器。是否会为这两个索引调用someFunctionB

Javascript AJAX调用期间和之后的事件注册(用于加载远程存储) 假设“load”在1毫秒后启动,并且计算机在2毫秒后注册的第一个侦听器。是否会调用someFunctionB 假设在800毫秒后触发“load”,计算机在2毫秒后注册第一个侦听器,在3毫秒后注册第二个侦听器。是否会为这两个索引调用someFunctionB,javascript,ajax,extjs,event-handling,dom-events,Javascript,Ajax,Extjs,Event Handling,Dom Events,代码: SomeClass=Ext.Extend(SomeSuperClass, initComponent:函数(){ 此['someStore']=new Ext.data.Store({ 代理:x(“y/z.asmx/s”), 阅读器:JSONReader([ {name:'g',type:'string',mapping:'g'}, ]), sortInfo:{字段:“g”,方向:“ASC”} }); 这个['someStore'].load( { 参数: { ID:this.confi

代码:

SomeClass=Ext.Extend(SomeSuperClass,
initComponent:函数(){
此['someStore']=new Ext.data.Store({
代理:x(“y/z.asmx/s”),
阅读器:JSONReader([
{name:'g',type:'string',mapping:'g'},
]),
sortInfo:{字段:“g”,方向:“ASC”}
});
这个['someStore'].load(
{
参数:
{
ID:this.config.ID
}
});
对于(var i=0;i
  • 第二,是

  • 你为什么不自己试试看呢?
    SomeClass = Ext.Extend(SomeSuperClass,
       initComponent: function () {
          this['someStore'] = new Ext.data.Store({
             proxy: x('y/z.asmx/s'),
             reader:JSONReader([
                { name: 'g', type: 'string', mapping: 'g' },
             ]),
             sortInfo: { field: 'g', direction: "ASC" }
             });
             this['someStore'].load(
             {
                params:
                {
                  ID: this.config.id
                }
            });
            for(var i = 0;i<2;i++){
               this.someFunctionA(i);
            }
        }
        someFunctionA: function(index){
           this['someStore'].on("load", function() {this.someFunctionB(index);}, this);
        }
        someFunctionB: function(index){
           var record = this['someStore'].getAt(index);
           console.log(record);
        }
    }