Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 671
confile Avatar asked Jan 27 '26 08:01

confile


1 Answers

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.

like image 189
Anna Tomanek Avatar answered Jan 28 '26 22:01

Anna Tomanek