【问题标题】:Django-ckeditor inline errorDjango-ckeditor 内联错误
【发布时间】:2012-09-16 18:06:39
【问题描述】:

我正在使用 FeinCMS (https://github.com/feincms/feincms/) 和支持文件上传的 django-ckeditor (https://github.com/shaunsephton/django-ckeditor)。

我为 RichTextField 创建了 FeinCMS 内容类型:

class RichContent(models.Model):
    text = RichTextField(_('text'))

    class Meta:
        abstract = True
        verbose_name = _('Rich Text')
        verbose_name_plural =_('Rich Text')

    def render(self, **kwargs):
        context_instance = kwargs.get('context_instance')

        return render_to_string('content/page/rich_content.html', {
            'page': self,
        }, context_instance=context_instance)

但是在 Django admin 中,当我选择“富文本”并按“Go”时,在 firebug 控制台中出现此错误:

uncaught exception: [CKEDITOR.editor] The instance "id_richcontent_set-__prefix__-text" already exists.

而且 ckeditor 中的 textarea 不可编辑。

【问题讨论】:

    标签: javascript django ckeditor feincms


    【解决方案1】:

    当您尝试使用已分配 CKEditor 实例的元素 (textarea) 创建新编辑器时,会发生这种情况。您可以通过探索CKEDITOR.instances 对象来使用控制台列出活动实例。

    我也相信这是解决您问题的方法:CKEditor instance already exists。您最好销毁现有实例或检测它并避免替换其 DOM 元素。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-07
      • 2013-03-23
      • 2012-11-16
      • 1970-01-01
      相关资源
      最近更新 更多