I tried using the code in https://docs.sencha.com/extjs/6.0.0/classic/Ext.form.field.Radio.html
to try making one of the radio fields hidden by adding some configs
boxLabel: 'XL',
name: 'size',
inputValue: 'xl',
id: 'radio3',
itemid: 'radio3Id'
and changed some code
//if XL is selected, change to L
if (radio3.getValue()) {
radio2.setValue(true);
return;
Ext.ComponentQuery.query('#rad3').hidden(true);
}
//if nothing is set, set size to S
radio1.setValue(true);
Ext.ComponentQuery.query('#radio3Id').hidden(false);
but it does not work. How can I hide the radio field dynamically? I did not want to use Ext.getCmp() because I plan to remove the id properties of the radio field and using the id property usually causes errors when using it multiple times.
Edited I tried the answers and they all work fine when I use the id property with Ext.getCmp(). I would like this to work with either reference or itemId..