CKEditor 即时编辑配置

CKEditor edit config on the fly

我有 config.js 文件,但我还想动态配置一些按钮。这是我的页面代码:

 CKEDITOR.on('instanceReady', function (evt)
                  {

                    CKEDITOR.instances.MY_INSTANCE.destroy();
                    CKEDITOR.config.toolbar_Basic = [['Bold']];
                    CKEDITOR.config.toolbar = 'Basic';
                    CKEDITOR.config.width=400;
                    CKEDITOR.config.height=300;
                    CKEDITOR.replace('MY_INSTANCE', CKEDITOR.config);
});

当我转到该页面时,文本区域一直在闪烁 appears/disappears。怎么了?如何动态更改ckeditor的配置?

PS。我看过 this answer,但对我帮助不大

使用这个:-

 CKEDITOR.replace( 'editor1', {
        language: 'fr',
        uiColor: '#9AB8F3'
    });

For More information click here

如果有人想知道多个编辑器的解决方案,我发现这是最好的解决方案。

$(".ckeditor").each(function() {
    CKEDITOR.replace($(this).attr("id"), {
        extraPlugins: 'justify,font'
    });
});