1

I have config.js file, but I also want to config some buttons dynamically. Here is my code for page:

 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);
});

when I go to the page, textarea is blinking and appears/disappears all time. What's wrong? How to change ckeditor's config dynamically ?

PS. I've seen this answer, but it didn't help me much

Community
  • 1
  • 1
John Smith
  • 831
  • 5
  • 19
  • 37

2 Answers2

1

Use This:-

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

For More information click here

1

In case anyone wondered about multiple editors solution, I find this to be the best one.

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