PDA

View Full Version : How to show/hide fieldset when a radio button is clicked?



JohnJones357
10 Feb 2014, 7:19 AM
I have a form with multiple radio buttons. Each radio button has a fieldset with fields for that button. How would I hide/show a fieldset when a radio button is clicked? Also, is it possible to use fireEvent when a radio button is clicked and listen for that event in the controller?

thanks!

jay@moduscreate.com
10 Feb 2014, 8:16 AM
Yes. Setup a listener in your form controller that handles that type of interaction.

palakurthivishal
10 Feb 2014, 8:18 AM
{
xtype : ' radio',
listeners : {
change :function(cmp, newVal){
//query your fieldset
var fieldset = cmp.up('fieldset');/cmp.down('fieldset');
if(newVal)
fieldset.enable();
else
fieldset.disable();
}
}
}