Reputation: 81
this is how I destroy CKEditor instance:
CKEDITOR.instances.Divname.destroy();
with Divname being id of the div.
but, how to destroy instance, if I use variable like this:
var x = "Divname";
CKEDITOR.instances.x.destroy();
It'll give me x is undefined error.
running example: http://jsfiddle.net/DBbYm/1/ please enable the instance (to attach editor), and then disable the instance (to destroy), and you'll get the error.
Any advice to solve this?
Upvotes: 1
Views: 2313
Reputation: 6619
In JS you could call members like this
var x = "Divname";
CKEDITOR.instances[x].destroy();
Upvotes: 8