Michael
Michael

Reputation: 33307

Remove toolbar buttons programmatically?

I use CKEditor 4.5 and have a toolbar with a source code button. I can remove it in config.js with:

config.removeButtons = "Source";

But this is not what I want. I want to remove this button programmatically using my editor instance:

var editor = CKEDITOR.replace("editorIdName");

I want to keep the values from config.removeButtons too.

How can I remove a toolbar button programmatically?

Upvotes: 3

Views: 2727

Answers (1)

Anna Tomanek
Anna Tomanek

Reputation: 2239

If you want to remove the Source button for a particular instance, you can use the in-page/per instance configuration method:

CKEDITOR.replace( 'editorIdName', {
   removeButtons: 'Source'
});

You can use this method to pass any configuration values to CKEditor instances.

Upvotes: 3

Related Questions