Extjs html编辑器以及如何自定义编辑器
您好,我一直在使用Extjs html编辑器。我想自定义html编辑器,就像我们在工具栏中单击按钮时必须显示自定义的警报框一样。我们如何才能做到这一点? 提前谢谢Extjs html编辑器以及如何自定义编辑器,extjs,Extjs,您好,我一直在使用Extjs html编辑器。我想自定义html编辑器,就像我们在工具栏中单击按钮时必须显示自定义的警报框一样。我们如何才能做到这一点? 提前谢谢 Ext.define('MyApp.ux.MyOwnHtmlEditor',{ extend: 'Ext.form.field.HtmlEditor', xtype: 'myhtmleditor', getToolbarCfg: function() { // get original tool
Ext.define('MyApp.ux.MyOwnHtmlEditor',{
extend: 'Ext.form.field.HtmlEditor',
xtype: 'myhtmleditor',
getToolbarCfg: function() {
// get original toolbar:
var toolbar = this.callParent(arguments);
// add custom item:
toolbar.items.push({
xtype: 'button',
iconCls: 'x-fa fa-question-circle',
handler: function() {
Ext.Msg.alert('Dear user!', 'No, we won\'t help you!');
}
});
// Modify handler of existing button:
toolbar.items[3].handler = function() {
Ext.MessageBox.alert('Dear user!', 'If you want Italic, please go to Italy!');
};
// return toolbar to calling function
return toolbar;
}
})
并使用它,例如,如下所示:
{
xtype: 'myhtmleditor'
}
并使用它,例如,如下所示:
{
xtype: 'myhtmleditor'
}
这个问题有点含糊不清。。为什么要这么警惕?什么工具栏?什么按钮?您希望警报看起来是什么样子,以及您希望它何时显示的任何图像?问题有点模糊。。为什么要这么警惕?什么工具栏?什么按钮?您希望警报看起来是什么样子,以及您希望警报何时显示的任何图像?