2013-11-25 51 views
1

你好,我有一個字符串,其中包含<br/>新行的標籤。它看起來像這樣:Extjs 4新行

"s = rod/Rel = ecc 6.7.3 6.5.0 6.7.0 6.7.1 6.6.0 6.7.2 6.2.0 6.1.0<br />Metric = Backlog<br />Severity = minor<br />Views = Monthly<br />" 

我想在文本精靈中使用它,但它好像文本不理解html標記。我該怎麼做?

var sprite = Ext.create('Ext.draw.Sprite', { 
      type: 'text', 
      surface: chart.surface, 
      text: Ext.util.Format.format('Metric generated with : '+ s), 
      font: '12px Arial', 
      x: 50, 
      y: 10, 
      width: 100, 
      height: 100 
     }); 

回答

-1

嘗試使用:\n爲linbreaks而不是<br/>

"s = rod/Rel = ecc 6.7.3 6.5.0 6.7.0 6.7.1 6.6.0 6.7.2 6.2.0 6.1.0\nMetric = Backlog\nSeverity = minor\nViews = Monthly\n" 
+0

現在它沒有顯示任何東西。 – salamey

+0

嘗試刪除'類型:'文本',' – benka

+0

同樣的事情發生 – salamey