javascript - Extjs 4新线

标签 javascript extjs

您好,我有一个包含 <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<br />Metric =   Backlog<br />Severity = minor<br />Views = Monthly<br />"

我想在文本 Sprite 中使用它,但文本似乎不理解 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 
        });

最佳答案

尝试使用:\n用于 linbreak 而不是 <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"

关于javascript - Extjs 4新线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20197555/

相关文章:

javascript - 根据输入从数组索引值返回值

javascript - 如何检查angularjs中的所有字段是否为空

javascript - 如何检查 extjs 中的表格单元格是否为空?

javascript - 如何引入类似ExtJs的类系统

javascript - 检查是否至少填写了一个表单字段

javascript - 使用键将数组中的对象分组并形成新的数组对象

javascript - Summernote 下拉菜单不适用于 Bootstrap 导航栏

javascript - 与异步自定义 react Hook 作斗争。如何等待一个钩子(Hook)的结果以在另一个钩子(Hook)中使用?

javascript - ExtJS 5.1 : Change Super Class at runtime

javascript - ExtJS DateField 渲染太宽,IE8 中的错误?