2016-10-01 91 views
1

中的許多行中打破長標籤,所以這裏是我的問題,我想在fieldset之前放置一個標籤,標籤文本很長。我需要在三行/行中包含這個長文本。我使用寬度,最小寬度,邊距等,但無法正常工作。是否有另一種簡單的方法來ix它?我希望你們瞭解我的問題。如何在Extjs

{ 
 
    xtype: 'container', 
 
    layout: { 
 
     type: 'hbox', 
 
     align: 'stretch', 
 
    }, 
 
    items:[, 
 
     { 
 
\t \t xtype: 'label', 
 
\t \t minWidth: 200, 
 
\t \t 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', 
 
\t \t marginRight: 
 
     }, 
 
     { 
 
      xtype: 'textfield', 
 
     }, 
 
    ] 
 
}

+0

請參閱標籤文本無法顯示即使在此代碼區域它的非常長的文本,所以我需要它像三條線。請別人幫我 –

回答

1

不要使用標籤。使用容器並填寫html配置。

詳細的解答:

label組件只能發揮出它的力量if you connect it to a field that can be focused when the label is clicked.

的ExtJS表單字段的標籤內容的包裝是由Labelable混入進行,而不是由label。 A fieldset沒有Labelable mixin,因爲它沒有字段。

這就是爲什麼你不需要標籤,你需要的東西,只是在佈局和顯示一些文本的空間。像容器一樣。

+0

您也可以在標籤上設置html屬性。 –