Hi, I am having this exact same problem, hopefully someone will help us out. I found this out after using the editor in my CMS to edit posts. When the user clicks on a post to edit it, an overlay appears with a ckeditor instance inside. This instance has the same name every time the user edits a post because it replaces the same textarea (in this case with an id of "post_content"), only the content it is filled with is differnet. When the user closes the overlay, the editor is destroyed by calling this code:
var editor = CKEDITOR.instances.post_content;
if (editor){editor.destroy();}
After this, any new instances will load fine and will pass their content using the "getData()" function (so users can still technically edit and save their posts) but none of the drop down menus work. As stated by pentijum, any subsequent instances' drop down menus will not function.
Is this a case of the instance still not being destroyed correctly? Would using the default numbered instance names alleviate the problem since the instance name will be different every time?
Well, it stinks that I don't know how to fix the problem at the source but I HAVE found a way around it. It seems this is linked with building and destroying an editor of the same instance name. The workaround, therefore, is to make sure each instance has a different name. I did this by just adding a global "counter" variable to my JS code and then incrementing it each time the code was called to create a new editor. I know that CKeditor is supposed to give each instance a default name of "editor+n" whenever it is built, but I have not seen how to enable this, so I just added my own counted to my code.
Anyways, I would like to know a more permanent solution to this but, hey, at least this is 'something'.
Re: Strange bug with dropdown list (styles, format, font, size)
I am having this exact same problem, hopefully someone will help us out. I found this out after using the editor in my CMS to edit posts. When the user clicks on a post to edit it, an overlay appears with a ckeditor instance inside. This instance has the same name every time the user edits a post because it replaces the same textarea (in this case with an id of "post_content"), only the content it is filled with is differnet. When the user closes the overlay, the editor is destroyed by calling this code:
var editor = CKEDITOR.instances.post_content; if (editor){editor.destroy();}After this, any new instances will load fine and will pass their content using the "getData()" function (so users can still technically edit and save their posts) but none of the drop down menus work. As stated by pentijum, any subsequent instances' drop down menus will not function.
Is this a case of the instance still not being destroyed correctly? Would using the default numbered instance names alleviate the problem since the instance name will be different every time?
Thanks in advance!
Re: Strange bug with dropdown list (styles, format, font, size)
Re: Strange bug with dropdown list (styles, format, font, size)
Anyways, I would like to know a more permanent solution to this but, hey, at least this is 'something'.
Hope this helps someone!
Re: Strange bug with dropdown list (styles, format, font, size)
Re: Strange bug with dropdown list (styles, format, font, size)
CANNOTbreaks