gpt4 book ai didi

javascript - 处理单击 Ext.js 面板标题

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

我正在尝试处理对 ext.js 面板标题的点击(与其他面板一起生活在 Accordion 内部..),现在标题是一个扩展标题,其中包含许多项目(不是工具)。问题是,当我设置 titleCollapse:true 时,对我的项目的点击会传播到标题,标题会折叠。

我想设置 titleCollapse:true 这样用户就可以通过单击标题来折叠/展开,而不仅仅是折叠工具。但是,那么,这个问题..

最佳答案

让我自己回答...

Ext.define("WebPhone.view.CallLogListHeader", {
extend: 'Ext.panel.Header',
xtype: 'callLogListHeader',
layout:
{
type: 'hbox',
align: 'middle',
pack: 'end'
},
//titlePosition: 0,
items:
[
{
xtype: 'button',
text: '',
cls: 'ClearCallLogButtonCls',
handler: function () {
var me = this;
me.container.component.handledByTool = true;
var view = Ext.create('WebPhone.view.ApproveClearLogs');
view.show();
}
}
],
initComponent: function()
{
var me = this;
me.callParent( arguments );
me.handledByTool = false;
},
listeners:
{
click: function()
{
var me = this;
if( me.handledByTool )
{
me.handledByTool = false;
return;
}

var parent = me.findParentByType( 'contact-list-view' );
if( parent.collapsed )
parent.expand();
else
parent.collapse();
}
}
});

关于javascript - 处理单击 Ext.js 面板标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24756947/

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