Page 1 of 1

Adding Custom button to CKEditor

Posted: 31 May 2018, 12:47
by singareddy
Hi All,
Here is example for adding custom button to CKEditor. http://jsfiddle.net/2j3btvLo/291/

editor = CKEDITOR.replace('container')
editor.addCommand("mySimpleCommand", {
exec: function(edt) {
alert(edt.getData());
}
});
editor.ui.addButton('SuperButton', {
label: "Click me",
command: 'mySimpleCommand',
toolbar: 'insert',
icon: 'https://avatars1.githubusercontent.com/ ... 9?v=2&s=16'
});


But how to do same functionality in pe:ckEditor

<pe:ckEditor id="editor" value="#{editorController.content}" toolbar="[['Cut','Copy','Paste','PasteText','PasteFromWord','-', 'SpellChecker', 'Scayt']]" skin="office2013">
<p:ajax event="save" listener="#{editorController.saveListener}" update="growl"/>
</pe:ckEditor>

Thanks

Ravi

Re: Adding Custom button to CKEditor

Posted: 05 Jun 2018, 14:56
by adamoantos
In the end I have acquired relevant knowledge on this subject, thank you!