我添加了一个浮动容器,在里面我添加了一个组件,如下所示,
var me = this;
var lastTab = me.getLastTabInTabPanel();
var iconContainer = me.down('#iconContainer');
if (iconContainer == null) {
iconContainer = Ext.create('Ext.panel.Panel', {
id: 'iconContainer',
floating: true,
shadow: false,
listeners: {
click: this.valIconClicked,
scope: this
},
style: 'margin-left:280px;',
items: [
{
xtype: 'component',
id: 'valIcon',
cls: 'valuation-tool-specview',
height: 33,
width: 26,
listeners: {
click: this.valIconClicked,
scope: this
}
}
]
});
}
iconContainer.showBy(lastTab, 'tl-tr');//, [-2, 0]
点击事件没有被解雇,我错过了什么吗?
答案 0 :(得分:3)
组件没有点击事件。但是你可以将听众附加到他们的元素点击,如下所示:
listeners: {
click: {
element: 'el',
scope: this,
fn: this.valIconClicked
}
}