You must handle the change event on each switch. When the radio button changes (selected), enable / disable the text box.
Following the example:
Ext.create ('Ext.container.Container', {
renderTo: Ext.getBody () ,
items: [{
xtype: 'textfield' ,
id: 'tf' ,
disabled: true ,
fieldLabel: 'My Text'
} , {
xtype: 'radiogroup',
fieldLabel: 'Enable / Disable ',
columns: 2,
vertical: true,
items: [{
boxLabel: 'Enable',
name: 'formtype' ,
inputValue: '1' ,
listeners: {
change: function (cb, nv, ov) {
if (nv) Ext.getCmp('tf').enable ();
}
}
} , {
boxLabel: 'Disable',
name: 'formtype',
inputValue:'2',
checked: true ,
listeners: {
change: function (cb, nv, ov) {
if (nv) Ext.getCmp('tf').disable ();
}
}
}]
}]
});
Ciao
source
share