Hello,
I want to disable toolbar items in an CKEditor instance. I guess this has to be done with the registered commands. I tried the following but it looks like some event after "pluginsLoaded" is enabling the command/button again (for a moment the source-Button is disabled):
What have I done wrong and is that the right approach to do it?
I hope i didn't overlooked a topic which already covers that - if so I'm sorry.
Sincerely,
Peter
I want to disable toolbar items in an CKEditor instance. I guess this has to be done with the registered commands. I tried the following but it looks like some event after "pluginsLoaded" is enabling the command/button again (for a moment the source-Button is disabled):
... this.editorinstance = CKEDITOR.replace(this.getEl().dom, this.config); this.editorinstance.on('pluginsLoaded', function(ev) { this.editorinstance.getCommand('source').disable(); }, this); ...
What have I done wrong and is that the right approach to do it?
I hope i didn't overlooked a topic which already covers that - if so I'm sorry.
Sincerely,
Peter
Re: How to disable toolbar items?
But I'm still not sure if this is the right approach...
Re: How to disable toolbar items?
It works for me too.
To CKEditor team:
Wouldn't it be simpler way to allow setting a command state side by side with adding the command? Like this
editor.addCommand('cmdName',execObj).setState(TRISTATE_DISABLED);
Re: How to disable toolbar items?
editor.getCommand( 'source' ).setState(0);
editor.getCommand( 'templates' ).setState(0);
Is there any way to disable all the buttons in one go and re-enable them in next click?