点击切换面板extjs4上的重复标题
我有一个可折叠面板的问题。我在顶部有一个带有切换图标的工具栏,但如果我点击面板的标题,它会展开,标题会重复。现在,如果我单击切换按钮来折叠它,则只会折叠重复的标题。 这是我的密码:点击切换面板extjs4上的重复标题,extjs,header,toggle,panel,expand,Extjs,Header,Toggle,Panel,Expand,我有一个可折叠面板的问题。我在顶部有一个带有切换图标的工具栏,但如果我点击面板的标题,它会展开,标题会重复。现在,如果我单击切换按钮来折叠它,则只会折叠重复的标题。 这是我的密码: Ext.define('Pollini.ricercaTarghe', { extend: 'Ext.panel.Panel', title: '<center>Ricerca per targa</center>', collapsed: true, reg
Ext.define('Pollini.ricercaTarghe', {
extend: 'Ext.panel.Panel',
title: '<center>Ricerca per targa</center>',
collapsed: true,
region: 'north',
id: 'ricercaTarghe',
height: 255,
layout: 'border',
initComponent: function(){
var me = this;
Ext.applyIf(me, {
items: [ searchTarga, risTarghe ],
tools: [
{
type: 'toggle',
handler: function(){
me.toggleCollapse(true);
}
}
],
listeners: {
expand: function(){
/* some stuff */
}
}
});
me.callParent(arguments);
}
});
Ext.define('Pollini.ricercaTarghe'{
扩展:“Ext.panel.panel”,
标题:“每塔加的Ricerca”,
对,,
地区:'北',
id:“ricercaTarghe”,
身高:255,
布局:“边框”,
initComponent:function(){
var me=这个;
Ext.applyIf(我{
项目:[searchTarga,risTarghe],
工具:[
{
键入:“切换”,
处理程序:函数(){
me.toggleCollapse(真);
}
}
],
听众:{
展开:函数(){
/*一些东西*/
}
}
});
me.callParent(参数);
}
});
这是一张图片
我试过这个。我真的不知道为什么,但它发生在渲染面板时,然后折叠面板。我所做的是给计时器一秒钟或几毫秒,然后调用toggleCollapse() 大概是这样的:
members.toggleCollapse(); // this will collapse the panel
// The timeout will then expand with the given time
setTimeout(function(){
accessPanel.toggleCollapse();
members.toggleCollapse();
}, 800}
幸运的是,重复的标题消失了。就像我说的,我真的不知道为什么,但这对我来说很有效。试一试。我已经试过了,但如果我点击面板标题(例如面板标题),它会在不等待800毫秒的情况下展开,标题会重复。如果我在800毫秒后单击切换工具,它将展开。可折叠:false,hideCollapseTool:true,floatable:false我添加了这些属性,但现在我无法以这种方式折叠面板展开和折叠面板的唯一方法是指定的按钮,该按钮将始终执行设置超时。我不知道这个规格是否适合你,但这就是我所做的。