这是我正在做的事情:
Ext.define('NG.view.taxinvoice.Widget', {
extend: 'NG.code.portal.Portlet',
alias: 'widget.taxinvoicewidget',
layout: 'card',
tools: [{
type: 'gear',
scope: this,
callback: 'onGearToolClick'
}],
items: [{
xtype: 'taxinvoicelist'
}, {
html: 'taxinvoicegraph'
}],
onGearToolClick: function (panel) {
alert('1111') This is not invoked!
}
});
警报声明永远不会被解雇......你能告诉我为什么吗?
更新
好的,它的工作方式是使用@kevhender 接受的答案,如下所示:
Ext.define('NG.view.taxinvoice.Widget', { 扩展:'NG.code.portal.Portlet',别名:'widget.taxinvoicewidget',布局:'card',
items: [{
xtype: 'taxinvoicelist'
}, {
html: 'taxinvoicegraph'
}],
initComponent: function () {
this.tools = [{
type: 'gear',
scope: this,
callback: 'onGearToolClick'
}];
this.callParent(arguments);
},
onGearToolClick: function (panel) {
alert('1111') Now it fires :)
}
});