I've added a new custom button using the code below. I want the button to be disabled when the editor is initially loaded. How to achieve this ? I tried to set the state to CKEDITOR.TRISTATE_DISABLED (see code below) but this doesn't work.
CKEDITOR.plugins.add('myButton',
{
init: function(editor)
{
var pluginName = 'myButton';
editor.addCommand('helloworld', {exec:helloWorld});
editor.getCommand('helloworld').setState(CKEDITOR.TRISTATE_DISABLED);
editor.ui.addButton('myButton',
{
label: 'New button',
command: 'helloworld',
icon: '/plugins/myButton/button.gif'
});
}
});
function helloWorld(e)
{
alert('Hello world');
}
