私はこのgridPanelを持っています:
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'...)
私はこの質問をイベントや Sencha ドキュメントへの絶え間ない参照として使用していますが、答えが見つかりませんでした。