ExtJS 3.4 Radiogroup strech关闭

Sto*_*pid 6 extjs

我有设置广播组中每个单选按钮的宽度的问题.

xtype: 'container',
id: 'cntCompany',
layout: 'hbox',
fieldLabel: 'Company',
items: [
    {
        xtype: 'radiogroup',
        id: 'rdogrpCompany',
        items: [
            { id: 'rdoIT', boxLabel: 'IT', name: 'rdoCompany', inputValue: 'IT', width: 40, checked: true },
            { id: 'rdoCOMMS', boxLabel: 'COMMS', name: 'rdoCompany', width: 40, inputValue: 'Comms' },
            { id: 'rdoGROUP', boxLabel: 'GROUP', name: 'rdoCompany', width: 40, inputValue: 'Group' },
            { id: 'rdoALL', boxLabel: 'ALL', name: 'rdoCompany', width: 40, inputValue: 'All', margins: '0 0 0 30' }
        ]
    }
]
Run Code Online (Sandbox Code Playgroud)

我设置每个单选按钮的宽度,但它无法正常工作.为什么这个radiogroup拉伸为相同宽度的列并忽略宽度:40?我如何设置每个单选按钮的宽度?

sra*_*sra 7

默认情况下,Combo-Group/Radio-Group使用列布局来对齐分组元素.并且如果没有设置其他内容,则使用'auto'作为默认值.

控件将在一行中每列呈现一个,并且每列的宽度将根据整个字段容器的宽度均匀分布.这是默认值.

基于API,它是一个布局问题.请注意,如果您没有定义一个,ExtJS将使用默认布局.因此,更改布局或尝试columns: 1解决您的问题.

API-链接

编辑: 基于评论正确的答案是columns: [40, 40, 40, 40]