Ticket #2424 (closed Bug: fixed)
API to destroy instances
| Reported by: | fredck | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.0 |
| Component: | General | Version: | FCKeditor 2.6.3 |
| Keywords: | Confirmed | Cc: | garry.yao |
Description
There must be a way to easily remove editor instances from the page, completely freeing resources used by those instances. This feature should be able to restore the <textarea> replaced by the instance, or remove it together with the editor.
Change History
comment:1 in reply to: ↑ description Changed 5 years ago by tha_sun
comment:2 Changed 4 years ago by tha_sun
- Version set to FCKeditor 2.6.3
Any updates? A fix for this does not sound that complex. Drupal's Wysiwyg API does the following to achieve the desired result:
var editor = FCKeditorAPI.GetInstance(params.field);
if (editor) {
$('#' + params.field).val(editor.GetXHTML()).show();
$('#' + params.field + '___Config').remove();
$('#' + params.field + '___Frame').remove();
delete FCKeditorAPI.__Instances[params.field];
}
Note: See
TracTickets for help on using
tickets.

Oww. I searched the past hours for a function in FCKeditor that does exactly this.
I am developing Wysiwyg API for Drupal (core), and all editors must be able to attach/detach cleanly from textareas, since the user is able to change the editor based on an external selector.
I'll try to work around this limitation now, but it would be beneficial for FCKeditor 2.6 if there were save() and remove() instance methods, similar to what other editors like TinyMCE provide.