【发布时间】:2017-12-14 14:42:04
【问题描述】:
我试图在Ext.MessageBox 标题内设置一个字体很棒的图标,我设法使用下面的代码来完成它:
Ext.Msg.show({
//iconCls: 'x-fa fa-times-circle',
title: '<span class="x-fa fa-exclamation"> Error Title</span>',
message: 'An error occured!!!!!',
buttons: Ext.MessageBox.OK,
width: 400
});
阅读docs 我发现我可以使用Ext.panel.Title 组件的配置对象来设置标题。
但是像下面的例子那样设置配置对象会使标题不可见。
title: {
text: 'Error Title',
iconCls: 'x-fa fa-exclamation'
}
我还从 Chrome 的开发工具的 Elements 选项卡中检查了视图,发现x-paneltitle 类中有一个用于图标的 div 元素。
<div class="x-icon-el x-font-icon" id="ext-element-15"></div>
如何使用Ext.panel.Title 配置设置MessageBox 标题?
【问题讨论】:
-
您最初的解决方案有什么问题?
-
它有效。我只是想知道如何使用 Ext.panel.Title 配置来做到这一点。
标签: javascript extjs extjs6 extjs6-modern