PDA

View Full Version : Resizing fieldsets



cgarvey
1 Jun 2007, 2:08 PM
Hey all,

I have a number of dialogs containing fieldsets which in turn contain comboboxes.
Some of these comboboxes may potentially contain option labels that are quite long so I want to allow the user to resize the combobox relative to the dialog i.e. if you make the dialog wider, you make the combobox wider.

This is easily achieved by attaching an onresize listener to the dialog and resizing the combobox. The problem I have run into is how to resize the enclosing fieldset. I note that Ext fieldsets do not behave exactly the same as their vanilla HTML counterparts insomuch as their default width is not the width of the largest object they contain + some padding.

Can anyone shed some light on the behaviour of fieldset containers and perhaps recommend a solution to link the size of the fieldset to the size of the dialog?

Thanks for reading.

tryanDLS
1 Jun 2007, 2:27 PM
You could save a ref to the fieldset when you create it, then do something like.


var fs = form.fieldset(....);
fs.getEl().setWidth(100);


You could also try navigating thru the form's stack property to find the fieldset/column. Didn't try that, but you could look at the objects in Firebug to see the structure and how you might go about it.

cgarvey
5 Jun 2007, 1:19 PM
Hi Tim,

Thanks Tim - that reference idea worked perfectly. I had tried that myself but was using:


var fsMyFieldset = new Form.fieldset({

which was throwing an exception.

Removing new did the job.

Thanks for the pointer.

Colm