首先,将新类 (customRadioGroup) 添加到您的 RadioGroup 组件中:
var RG2 = Ext.create({
xtype: 'radiogroup',
componentCls: 'customRadioGroup', // new class to identify RadioGroup
fieldLabel: 'more lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text lots of text ',
items: [
{ boxLabel: 'Item 1', name: 'rb', inputValue: '1' },
{ boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true},
{ boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
{ boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
{ boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
{ boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
]
});
和样式组件:
.customRadioGroup .x-form-item-body {
vertical-align: top;
}
P.S.:布局适用于单选按钮,但不适用于单选组。