gpt4 book ai didi

ExtJS 3.4 Radiogroup strech 关闭

转载 作者:行者123 更新时间:2023-12-04 14:49:45 27 4
gpt4 key购买 nike

我在设置单选组中每个单选按钮的宽度时遇到问题。

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' }
]
}
]

我设置了每个单选按钮的宽度,但它不能正常工作。
为什么这个 radio 组拉伸(stretch)为相同宽度的列并忽略宽度:40?
如何设置每个单选按钮的宽度?

最佳答案

默认情况下,Combo-Group/Radio-Group 使用列 Layout 来对齐分组的元素。如果没有设置其他值,则使用“auto”作为默认值。

The controls will be rendered one per column on one row and the width of each column will be evenly distributed based on the width of the overall field container. This is the default.



基于 API,这是一个布局问题。请注意,如果您没有定义,ExtJS 使用默认布局。所以改变布局或尝试 columns: 1解决你的问题。

API-Link

编辑:
根据评论,正确答案是 columns: [40, 40, 40, 40]

关于ExtJS 3.4 Radiogroup strech 关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8706375/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com