1 var radios = Ext.create('Ext.form.Panel', { 2 title: 'RadioGroup Example', 3 width: 300, 4 height: 125, 5 bodyPadding: 10, 6 renderTo: Ext.getBody()... ...
1 var radios = Ext.create('Ext.form.Panel', { 2 title: 'RadioGroup Example', 3 width: 300, 4 height: 125, 5 bodyPadding: 10, 6 renderTo: Ext.getBody(), 7 items:[{ 8 xtype: 'radiogroup', 9 fieldLabel: 'Two Columns', 10 // Arrange radio buttons into two columns, distributed vertically 11 columns: 2, 12 vertical: true, 13 items: [ 14 { boxLabel: 'Item 1', name: 'rb', inputValue: '1' }, 15 { boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true}, 16 { boxLabel: 'Item 3', name: 'rb', inputValue: '3' }, 17 { boxLabel: 'Item 4', name: 'rb', inputValue: '4' }, 18 { boxLabel: 'Item 5', name: 'rb', inputValue: '5' }, 19 { boxLabel: 'Item 6', name: 'rb', inputValue: '6' } 20 ] 21 }] 22 });
裡面有設置項,把checked設為true,拿值的話用
var val = radios.down('radiogroup').getValue()['rb'];
摘自百度問答,地址:https://zhidao.baidu.com/question/981847790759065939.html