1

我在使用 CKEditor 的自动增长功能时遇到问题,我在使用返回部分视图的 MVC 和 ajax 帖子的页面中使用它,当我触发某些 $ajax 帖子(特别是那些返回部分而不重新加载页面的帖子)时,我收到了以下错误:未捕获 [CKEDITOR.resourceManager.add] 资源名称“autogrow”已注册。

我想知道是否有一种方法可以“取消注册”自动增长功能并在流程完成后重新注册它。或者,如果有简单的方法可以避免这一切,除了location.reload(true).

感谢您的帮助!

4

1 回答 1

0

您应该在“ckeditor”的“plugins”文件夹中创建一个名称为按钮的文件夹,并在该文件夹中创建文件“plugin.js”,然后您可以使用新按钮的代码。例如: - ckeditor/plugins/timestamp/plugin.js

我的代码:

CKEDITOR.plugins.add( 'timestamp', {
init: function( editor ) {
    editor.addCommand( 'insertTimestamp', {
        exec: function( editor ) {
    editor.insertHtml( 'text' );
        }
    });
    editor.ui.addButton( 'Timestamp', {
        label: 'Insert Timestamp',
        command: 'insertTimestamp',
        toolbar: 'insert.0'
    });
}

});

于 2019-04-26T14:11:31.233 回答