extjs 中的浮动容器或组件不会触发事件
Events are not getting fired on floating container or component in extjs
我添加了一个浮动容器并在其中添加了一个组件,如下所示,
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]
点击事件没有被触发,我错过了什么吗?
组件没有点击事件。但是您可以像这样将侦听器附加到他们的元素的点击:
listeners: {
click: {
element: 'el',
scope: this,
fn: this.valIconClicked
}
}
我添加了一个浮动容器并在其中添加了一个组件,如下所示,
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]
点击事件没有被触发,我错过了什么吗?
组件没有点击事件。但是您可以像这样将侦听器附加到他们的元素的点击:
listeners: {
click: {
element: 'el',
scope: this,
fn: this.valIconClicked
}
}