Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Multiselect in a Radio group extjs

I have a radiogroup component in a panel in extjs with 3 radiobuttons. But I can select multiple rediobuttons at once, whereas radiogroups should allow to select only one. It should be the default behaviuor.

I couldn't find any configuration attribute in radiogroup component to disallow multiselect.

Is there any way to disable multiselect in a radio group in extJs.

like image 806
Sumit Jain Avatar asked Aug 22 '12 07:08

Sumit Jain


1 Answers

The configuration is under the radio. Each radio button under the radio group should have the same name. Take a look at the code below.

xtype: 'radiogroup'
,fieldLabel: 'Sample radiogroup'
,items: [
    {boxLabel: 'Item 1', name: 'same-name', inputValue: 1}
    ,{boxLabel: 'Item 2', name: 'same-name', inputValue: 2, checked: true}
    ,{boxLabel: 'Item 3', name: 'same-name', inputValue: 3}
    ,{boxLabel: 'Item 4', name: 'same-name', inputValue: 4}
    ,{boxLabel: 'Item 5', name: 'same-name', inputValue: 5}
]
like image 141
Ben Avatar answered Sep 28 '22 04:09

Ben