【发布时间】:2020-06-29 09:02:40
【问题描述】:
有没有办法在文本字段中插入下一个值:
随机 (1234)
但在文本字段中将其可视化如下:
因为我从服务器检索信息如下:
"property1" : "Random (<span style='color:red;'>1234</span>)
文本字段在表单内,当我检索信息时,我使用loadRecord 将数据加载到表单中。
【问题讨论】:
标签: javascript extjs extjs4.2
有没有办法在文本字段中插入下一个值:
随机 (1234)
但在文本字段中将其可视化如下:
因为我从服务器检索信息如下:
"property1" : "Random (<span style='color:red;'>1234</span>)
文本字段在表单内,当我检索信息时,我使用loadRecord 将数据加载到表单中。
【问题讨论】:
标签: javascript extjs extjs4.2
恕我直言,不可能使用“Ext.form.field.Text”来显示彩色文本。 但您可以使用显示字段(只读)或 html 编辑器..
new Ext.panel.Panel({
title: 'Form',
renderTo: Ext.getBody(),
width: 550,
height: 250,
frame: true,
layout: 'form',
items: [{
xtype: 'htmleditor',
fieldLabel: "HTML Editor",
enableColors: false,
enableAlignments: false,
value: "Random (<span style='color:red;'>1234</span>)",
}, {
xtype: 'displayfield',
fieldLabel: "Display Field",
value: "Random (<span style='color:red;'>1234</span>)",
}]
});
【讨论】: