For one thing, the individual radio buttons must be items of the radio group. Here, you've got the items
keys that is duplicated in your config object, meaning you actually end up with 2 radios in your panel, but no radio group.
Then, simple panels do not have support for displaying labels. You must use a form panel for that.
Finally, you probably want to give all the radio in the group the same name
, so that myForm.getForm().getValues()
returns something like {myField: "Yes"}
(the value will be taken from inputValue
).
So here's what you're trying to do:
Ext.ComponentMgr.create({
xtype: 'form', // notice the changed xtype
renderTo: Ext.getBody(),
border: false,
items: [{
fieldLabel: 'Please select ',
xtype: 'radiogroup',
id: 'id1',
columns: 2,
vertical: false,
// radio buttons must be children of the radio group
items: [{
boxLabel: 'Yes',
// you probably want to give your radios the same name
name: 'myField',
inputValue: 'Yes'
}, {
boxLabel: 'No',
name: 'myField',
inputValue: 'No'
}]
}]
});