How to destroy tinyMce?

I am using the latest version 3.4.b3. I have this in a dialog box and the content is being created dynamically.

So this means that a text field that tiny must bind itself is created every time. Therefore, when I load a dialog, the first time a tiny one appears. If I download the dialog again, the dialog will not appear again.

Therefore, I think that I need to destroy the tiny ones on closing the dialog box, and then create it again at boot time.

I tried using remove, but getting this error

ReferenceError: t is not defined http://localhost:3000/Site Line 0 

So not sure what that means.

+6
jquery tinymce
source share
1 answer

You must close tinymce correctly in order to be able to reinitialize the tinymce editor with the same identifier as the first.

To close the edtor instance, follow these steps:

 tinymce.execCommand('mceRemoveControl',true,'editor_id'); 

To reinitialize use

 tinymce.execCommand('mceAddControl',true,'editor_id'); 
+9
source share

All Articles