PDA

View Full Version : Can't get SetVisible to work with Container



wdtracy
6 Jul 2011, 3:05 PM
I want to have a portion of a FieldSet appear when a box is checked so I am using the following:


var didacticCheck = new Ext.form.Checkbox({
label: 'Didactic',
listeners: {
check: function() {
didacticHidden.setVisible(this.isChecked());
},
uncheck: function() {
didacticHidden.setVisible(this.isChecked());
}
}
});

var didacticHidden = new Ext.Container({
hidden: true,
defaults: {labelWidth: '8em'},
items: [
{
xtype: 'datepickerfield',
label: 'Date'
}
]
});

var didacticSet = new Ext.form.FieldSet({
defaults: {labelWidth: '8em'},
items: [didacticCheck, didacticHidden]
});

The problem is that the Container will not become visible. If I replace it with something from Ext.form, it works. I'm being picky, but I want the nice formatting of the FieldSet because I plan to use the 'title' field and I want everything to end up looking like it is pant of the section. The API shows that Container has SetVisible() so I am pulling my hair out!

Thanks,

Wade