I have Ext.form.FieldSet with some fields in it. It looks like:
var register_options = new Ext.form.FieldSet({
autoHeight: true,
title: 'My Title',
checkboxToggle: true,
checkboxName: 'register_options',
items: [item1, item2, item3]
});
When my fieldset checkbox is unchecked (fieldset is collapsed) i don't want submit any of its fields (item1, item2...).
I can do this by adding some listeners and disabling fields:
listeners: {
collapse: function(p) {
p.items.each(function(i) {
i.disable();
},
this);
},
expand: function(p) {
p.items.each(function(i) {
i.enable();
},
this);
}
}
Is it proper way, how can i do this better?