PDA

View Full Version : FieldSet collapse and expand via other component listeners



KirthiRaman5
16 Sep 2010, 4:12 AM
I have several components that are of type FieldSet and since the Form is a little bigger than normal display size can handle, I thought if I could toggle expand collapse between the two FieldSet types that does not have to be displayed at once. So, I added listeners
listeners: {
expand: function(danim, animarg){
alert("Expanded Other Contact");
var primecontact = Ext.getCmp('prime-cont');
primecontact.collapsed = true;
primecontact.doLayout(); // do I have to do call form layout as well?
}
Tried all combination, nothing seems to work. Any idea how I can do this?

KirthiRaman5
16 Sep 2010, 4:45 AM
I figured two things that I did wrong.

listener should be

expand: function(obj){
alert("Expanded Other Contact");
var primecontact = Ext.getCmp('prime-cont');
primecontact.collapse();
primecontact.doLayout();
form.doLayout();
}