Adding Custom button to CKEditor

Community Driven Extensions Project
Post Reply
singareddy
Posts: 23
Joined: 28 Dec 2012, 21:26

31 May 2018, 12:47

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

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

31 May 2018, 13:14

I think you need to use the customConfig="" property of the pe:ckeditor.
customConfig = Path to a custom CKEditor js config file.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests