【发布时间】:2015-07-17 22:48:05
【问题描述】:
我有这个网格面板:
Ext.define('BM.view.test.MacroList', {
extend: 'BM.view.GridPanel',
alias:'widget.macro-test-list',
store: 'Tests',
initComponent: function() {
this.columns = [
{
xtype:'actioncolumn',
width:50,
items: [
{
icon: 'images/start.png',
tooltip: 'Start Test',
handler: function(grid, rowIndex, colIndex) {
this.application.fireEvent('testStart', grid.getStore().getAt(rowIndex));
// application not defined here because 'this' is the button.
}]
}]
}
}
stratTest 是一个可在应用程序的许多地方使用的函数,我希望将其用作应用程序范围的事件,但这些似乎只能从控制器中使用。
如何从该按钮内的处理程序调用.application.fireEvent('testStart'...)?
我使用this question 作为对事件和 Sencha 文档的常量引用,但找不到答案。
【问题讨论】: