PDA

View Full Version : open and close a fieldset by an other function



ballibum
3 May 2010, 2:23 AM
Hallo Forum,
ive got a formpanel with two fieldset-elements. now, i want that only one of them is open. SO i need i function, that closes the second one by opening the other one.

can someone help me?

thanks a lot


klima = new Ext.FormPanel({
frame:true,
border:false,
name:'klima',
autoWidth: true,
autoHeight: true,
items: [{
xtype:'fieldset',
id:'manuelleAuswahl',
title: 'manuelle Auswahl',
autoHeight:true,
defaults: {width: 210},
defaultType: 'textfield',
collapsible: true,
collapsed: true,
html:'<table><tr><td class="kursiv">Stationsauswahl:</td><td><div id="timtest"></div></td></tr></table>',
items :[jahresauswahl2 ]
},{
xtype:'fieldset',
title: 'dynamischer kartenmodus',
autoHeight:true,
id:'kartenAuswahl',
defaults: {width: 210},
defaultType: 'textfield',
collapsible: true,
collapsed: true,
items :[jahresauswahl, stationsanzeige ]
}]
});

Nesta
3 May 2010, 2:40 AM
fieldset has expand and collapse listeners.

something like this should do what you want


var fieldset1 =
klima = new Ext.FormPanel({
...
items: [{
xtype:'fieldset',
id:'manuelleAuswahl',
items :[jahresauswahl2 ],
....
listeners: {
collapse: function(panel){
klima.findById('kartenAuswahl').expand();
}
}
},{
xtype:'fieldset',
title: 'dynamischer kartenmodus',
listeners:{
collapse: function(panel){
klima.findById('manuelleAuswahl').expand();
}
}
}]
});