Remove CKEdit Instance
Posted
by Laramie
on Stack Overflow
See other posts from Stack Overflow
or by Laramie
Published on 2010-06-06T18:37:22Z
Indexed on
2010/06/06
18:42 UTC
Read the original article
Hit count: 419
I have an issue creating multiple instances of CKEdit with different toolbars wherein the second instance created is replacing the toolbar of the first. Unfortunately I can only reproduce it in a huge page containing update panels, which I suspect is the issue. That said, the issue at this point is I can't seem to destroy instances of CKEdit per the documentation.
Consider the following:
<input name="txt1" type="text" id="txt1" /><br />
<a href="javascript:void(0);" onclick="create()">Create</a><br />
<a href="javascript:void(0);" onclick="destroy()">Destroy</a>
<script type= "text/javascript" >
<!--
function create() {
var hEd = CKEDITOR.instances['txt1'];
if (hEd) {
CKEDITOR.remove(hEd);
}
hEd = CKEDITOR.replace('txt1');
}
function destroy(){
var hEd = CKEDITOR.instances['txt1'];
if (hEd) {
CKEDITOR.remove(hEd);
}
}
-->
</script>
When destroy() runs, CKEDITOR.remove(hEd); is being called. Multiple clicks to create() produce multiple instances of CKEditor on screen, but their instances no longer appear in CKEDITOR.instances.
Am I missing something?
© Stack Overflow or respective owner