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通话中按下了按钮。感谢您的大力帮助!