Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs html编辑器以及如何自定义编辑器_Extjs - Fatal编程技术网

Extjs 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

您好,我一直在使用Extjs html编辑器。我想自定义html编辑器,就像我们在工具栏中单击按钮时必须显示自定义的警报框一样。我们如何才能做到这一点? 提前谢谢

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'
}

这个问题有点含糊不清。。为什么要这么警惕?什么工具栏?什么按钮?您希望警报看起来是什么样子,以及您希望它何时显示的任何图像?问题有点模糊。。为什么要这么警惕?什么工具栏?什么按钮?您希望警报看起来是什么样子,以及您希望警报何时显示的任何图像?