所以这是我的问题我想在字段集之前放置一个标签并且标签文本很长。我需要将这个长文本分成三行/行。我使用了宽度、最小宽度、边距等,但没有用。还有另一种简单的方法来修复它吗?我希望你们理解我的问题。
{
xtype: 'container',
layout: {
type: 'hbox',
align: 'stretch',
},
items:[,
{
xtype: 'label',
minWidth: 200,
text: 'Hard Surface Flooring and Base: Attach asddsad that asdasd enter hsjsa description[enter image description here][1] hersahaksjecomplies with asd or CA01350 Note:asdhjasd-based products such as asdads tile are exempt',
marginRight:
},
{
xtype: 'textfield',
},
]
}
最佳答案
不要使用标签。使用容器并填写 html
配置。
详细答案:
label
组件只能发挥它的优势if you connect it to a field that can be focused when the label is clicked.
ExtJS 表单字段的标签内容的包装是由 Labelable
mixin 完成的,而不是由 label
完成的。 fieldset
没有 Labelable
混合宏,因为它没有字段。
这就是为什么您不需要标签,您需要的只是在布局中占用空间并显示一些文本的内容。就像容器一样。
关于javascript - 如何在 Extjs 中打破多行的长标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39807940/