PDA

View Full Version : expand panel in accordion when other is collapsed



karstenvennemann
17 Aug 2010, 6:56 AM
Hi I have two form panels in a Ext.Panel with accordion Layout. I tried to figure out from the docs how to expand one panel when the other is collapsed (basically toggle between the two so that one is always expanded the other closed). But it seems there is no public event associated with collapse... How can I add an event listener to do that ?
Thanks Karsten

var accordion = new Ext.Panel({
defaults: {
// applied to each contained panel
bodyStyle: 'padding:15px'
},
region:'east',
titleCollapse:true,
hideCollapseTool:true,
split:true,
width : '25%',
height: '100%',
layout:'accordion',
items: [panel1, panel2]
});

Mogileswara Rao
16 Sep 2010, 3:21 AM
Hi karsten,

Have u find any solution for your problem. I need the solution. If you know please let me know.

Thanks in advance
Mogileswara Rao

Mogileswara Rao
16 Sep 2010, 3:27 AM
HI All,

Please help me out for below problem,
I have some 3 items in an accordion layout, in that one should be always expand and others should be collapsed at a time. but in a case i am seeing all items are collapsed when i am clicking on expanded item, i don't like this. If i click on expanded item it still expand it should not collapse such that always one item will be open i mean expanded.

karstenvennemann
28 Sep 2010, 9:58 AM
I added this function to my panel1 code after listeners and before buttons. So if panel1 is collapsed panel2 will be expanded (via this call panel2.expand(true); )
Karsten



..., items: [
{xtype: 'textfield',
name: 'notes',
allowBlank: true,
fieldLabel: 'Notes',
width: 200,
listeners:
{
render: function(c) {
Ext.QuickTips.register({
target: c.getEl(),
text: 'Enter notes'
});
},
collapse: function(){
panel2.expand(true);
}
}
}],buttons...