【问题标题】:Issue with CKEditor Autogrow featureCKEditor 自动增长功能的问题
【发布时间】:2012-08-01 13:47:28
【问题描述】:

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

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

感谢您的帮助!

【问题讨论】:

  • 您是否将完整的 CKEDITOR js 文件作为脚本参考发送到您的部分?
  • 它是完整的文件,但它在包含部分的主页上被引用
  • 您能提供一个代码示例吗?并解释你是如何设置配置的,请

标签: jquery ajax model-view-controller ckeditor


【解决方案1】:

您应该在“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'
    });
}

});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多