View Full Version : TwinTriggerField not displayed within collapsed fieldset

6 May 2009, 11:38 PM

I've got a little problem: when I use a TwinTriggerField in a FieldSet which is collapsed by conf, it is not rendered when expanding the FieldSet.

Here is a sample code:

var test_form = new Ext.form.FormPanel({
renderTo: document.body,
items: [
new Ext.form.FieldSet ({
title: 'test',
id: 'ecv_test_fieldset',
autoHeight: true,
collapsible: true,
//collapsed: true,
items: [
new Ext.form.TwinTriggerField ({
trigger1Class: 'x-form-search-trigger',
trigger2Class: 'x-form-clear-trigger',
fieldLabel: 'test twin'
This is working great, but uncomment the "collapsed" config line, and when expanding the fieldset the TwinTriggerField doesn't display any more.

I've seen few posts with the same issue, but couldn't find any answer. If anyone could solve this, it would be very helpfull !


6 May 2009, 11:44 PM
This is an ongoing issue over which there is some discussion.

Collapsing uses style display:none, and rendering in a display:none element causes problems.

There is some code suggested by Condor which defers rendering in hidden or collapsed Containers until show/expand completion which will help if/when accepted by the dev team.

In the meantime, try removing the collapsed:true config. Instead execute a collapse call sometime after render. It's not that clean, but it should work.

7 May 2009, 4:21 AM
I extended FieldSet with a delayed collapse on render event. That is quite dirty and visible, and depending on the client computer/bandwidth the needed delay is different. But, it works.
Thanks Animal, I hope for a cleaner solution soon.

7 May 2009, 6:42 AM
Try it on the afterlayout event with no delay. Just use the single: true option so that it only does it the first time it lays this child Components out!