gpt4 book ai didi

javascript - extjs 中的 float 容器或组件不会触发事件

转载 作者:行者123 更新时间:2023-11-30 11:43:18 25 4
gpt4 key购买 nike

我添加了一个 float 容器并在其中添加了一个组件,如下所示,

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
}
}

关于javascript - extjs 中的 float 容器或组件不会触发事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41888185/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com