I want to add a custom "save" button to my Editor; here is my code:
CKEDITOR.plugins.add('mysave', { init: function (editor) { editor.addCommand('mysave', { exec: function (editor) { // Save the content to database using Ajax // .... editor.destroy(false); } }); editor.ui.addButton('MySave', { label: 'Save', command: 'mysave', icon: this.path + 'images/disk.png' }); } });
The problem is the "editor.destroy" call. I call it to hide the Editor and display the html but I get an error:
M is null
http://localhost/MySite/ckeditor_3.6.2/ckeditor.js
Line 100
What is wrong? Should I use another method than destroy?