Hi guys,
Been looking and trying different things mentioned on other threads but no joy.
The issue is that I load different forms containing textareas into the screen via ajax.
These forms can contain textareas with the same id (not in the same form and not in the screen at the same time).
All text areas that i want to use ckeditor on have the class 'wysiwyg'.
The problem is that when the form gets redrawn via ajax, the textareas which have an id that was previously used (in a previous load) fail, and i get the "i.contentWindow is null" error.
This is my code after hashchange view reload:
I opted for delete instead of remove() or destroy() as i kept getting the duplicate instance error. With delete that error is gone, but i cant get it working.
What am i missing?
Any help or suggestions would be greatly appreciated!
Been looking and trying different things mentioned on other threads but no joy.
The issue is that I load different forms containing textareas into the screen via ajax.
These forms can contain textareas with the same id (not in the same form and not in the screen at the same time).
All text areas that i want to use ckeditor on have the class 'wysiwyg'.
The problem is that when the form gets redrawn via ajax, the textareas which have an id that was previously used (in a previous load) fail, and i get the "i.contentWindow is null" error.
This is my code after hashchange view reload:
var $editors = $(".wysiwyg"); if ($editors.length) { $editors.each(function() { var editorID = $(this).attr("id"); var instance = CKEDITOR.instances[editorID]; if (instance) { delete CKEDITOR.instances[editorID]; instance=null; } }); } $('.wysiwyg').ckeditor({ resize_enabled: false, toolbar_Full: [ ['Format','Bold','Italic','Underline','Strike','TextColor','-','NumberedList','BulletedList','-','RemoveFormat'], ['Link','Unlink','-','Image','Flash','Table'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellCheck'], ['Maximize','-','Source'] ] });
I opted for delete instead of remove() or destroy() as i kept getting the duplicate instance error. With delete that error is gone, but i cant get it working.
What am i missing?
Any help or suggestions would be greatly appreciated!
Re: CKeditor jquery ajax issues
Re: CKeditor jquery ajax issues
The only correct way to remove a CKEditor instance is by using its destroy method.
If you use delete you're just removing a reference to it in an array, but the rest of references remain there and they can generate problems like this one or just memory leaks.
This code should work unless you have done something really strange and unexpected
I guess that if http://dev.ckeditor.com/ticket/8226 is ever fixed this kind of problem will be moot, even if you're not aware of the "noUpdate" parameter.
Re: CKeditor jquery ajax issues
I had tried that originally, and trying it again... but i get:
Re: CKeditor jquery ajax issues
Re: CKeditor jquery ajax issues