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
if ($editors.length) { $editors.each(function() { var editorID = $(this).attr("id"); var instance = CKEDITOR.instances[editorID]; if (instance) instance.destroy(true); }); }http://dev.ckeditor.com/ticket/8226
Re: CKeditor jquery ajax issues
I had tried that originally, and trying it again... but i get:
uncaught exception: [CKEDITOR.editor] The instance "text" already exists. i.contentWindow is null getFrameDocument()ckeditor.js (line 21) getSnapshotData()ckeditor.js (line 103) init(o=Object { name="getSnapshot", sender={...}, editor={...}})ckeditor.js (line 129) getUrl(o=Object { _={...}, elementMode=1, element={...}, more...}, p=undefined, q=function(), r=function())ckeditor.js (line 6) getUrl(h="getSnapshot", i=undefined, j=Object { _={...}, elementMode=1, element={...}, more...})ckeditor.js (line 6) hasListeners(b="getSnapshot", c=undefined)ckeditor.js (line 7) u()ckeditor.js (line 26) setReadOnly()ckeditor.js (line 27) init()ckeditor.js (line 129) getUrl(o=Object { _={...}, elementMode=1, element={...}, more...}, p=Object {}, q=function(), r=function())ckeditor.js (line 6) getUrl(h="mode", i=Object {}, j=Object { _={...}, elementMode=1, element={...}, more...})ckeditor.js (line 6) hasListeners(b="mode", c=Object {})ckeditor.js (line 7) load()ckeditor.js (line 102) [Break On This Error] ...;return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes...Re: CKeditor jquery ajax issues
Re: CKeditor jquery ajax issues
for(var instanceName in CKEDITOR.instances) { CKEDITOR.instances[instanceName].destroy(); } $(".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'] ] });