Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.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
Extjs 如何在使用其引用选择的按钮上激发事件_Extjs_Extjs5 - Fatal编程技术网

Extjs 如何在使用其引用选择的按钮上激发事件

Extjs 如何在使用其引用选择的按钮上激发事件,extjs,extjs5,Extjs,Extjs5,我定义的按钮如下: { xtype : 'button', reference : 'button1' } 我希望能够使用以下语法选择它: this.lookupreference("button1"); 然后在其上触发单击事件。 此语法正确吗:this.lookupreferencebutton1.fireventclick? 如果没有,那么如何使用lookupreference来实现呢 谢谢 方法是lookupReference而不是lookupRef

我定义的按钮如下:

{
    xtype : 'button',
    reference : 'button1'
}
我希望能够使用以下语法选择它:

this.lookupreference("button1");
然后在其上触发单击事件。 此语法正确吗:this.lookupreferencebutton1.fireventclick? 如果没有,那么如何使用lookupreference来实现呢


谢谢

方法是lookupReference而不是lookupReference

要记住一些重要的事情:

引用缓存基于控制器。因此,在组件层次结构中必须有一个控制器


当我拉小提琴时,我注意到两件事,第一件是button1.fireEvent'click'没有执行处理程序方法。该按钮必须具有“单击”事件侦听器。其次,fireEvent在默认情况下没有通过按钮。也就是说,单击按钮时,按钮将是事件的第一个参数。因此,我在fireEvent通话中按下了按钮。

感谢您的大力帮助!