【问题标题】:Add buttons to HTML editor in extJs在 extJs 中向 HTML 编辑器添加按钮
【发布时间】:2016-01-14 21:23:06
【问题描述】:

我在 extJs 中使用了 htmleditor,但没有选项可以编辑框内的文本。所以我自己创建了按钮并放在文本编辑器中,但看起来不太好。

有什么方法可以将按钮(同一行中的 2 个按钮)添加到 html 文本编辑器。 简而言之,我想在 html 编辑器下方添加“保存”和“取消”按钮。

我该怎么做?

【问题讨论】:

标签: javascript extjs


【解决方案1】:

您可以使用ExtJS.ux.HtmlEditor.Plugins -(ExtJS HtmlEditor 扩展功能的插件集)来创建您自己的按钮。您应该做的一件事是在插件中扩展 Ext.ux.form.HtmlEditor.MidasCommand...然后将其添加到您的 js 文件中:

Ext.ux.form.HtmlEditor.Save= Ext.extend(Ext.ux.form.HtmlEditor.MidasCommand, {
    midasBtns: ['|',{
        cmd: 'save',
        title: 'Save'
    }]
});

对于按钮图标,您可以使用这种样式:

.x-save {background: url(../images/save.png) 0 0 no-repeat !important;}

【讨论】:

    【解决方案2】:

    你可以使用 ExtJS.ux.HtmlEditor.Plugins

    https://github.com/VinylFox/ExtJS.ux.HtmlEditor.Plugins

    【讨论】:

      猜你喜欢
      • 2014-09-25
      • 1970-01-01
      • 1970-01-01
      • 2011-06-11
      • 1970-01-01
      • 1970-01-01
      • 2011-07-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多