javascript - 如何在 Extjs 中打破多行的长标签

标签 javascript css extjs sencha-touch sencha-architect

所以这是我的问题我想在字段集之前放置一个标签并且标签文本很长。我需要将这个长文本分成三行/行。我使用了宽度、最小宽度、边距等,但没有用。还有另一种简单的方法来修复它吗?我希望你们理解我的问题。

{
   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/

相关文章:

javascript - 如何在点击按钮后进入休眠状态

javascript - 如何为选项卡 View 设置合适的大小?

javascript - ExtJs4 Json TreeStore?

java - 带有特殊字符的 BUG YUICompressor

PHP 路径位置

css - 如何将CSS设置为移动网站

css - mgwt IconHandler 和颜色 3 位十六进制错误

gridview - 带有复选框的 Extjs 网格面板

EXTJS 3.3.3 网格

javascript - 3 切换表格列排序