开发者

How to destroy tinyMce?

开发者 https://www.devze.com 2023-02-14 11:07 出处:网络
I am using the latest开发者_JAVA技巧 version 3.4.b3. I have it in a dialog and it\'s contents are created dynamically.

I am using the latest开发者_JAVA技巧 version 3.4.b3. I have it in a dialog and it's contents are created dynamically.

So this means the textarea that tiny should bind itself to gets created every single time. So when I load up the dialog for the first time tiny shows up. If I load up the dialog a second time the dialog does not show up again.

So I think I need to destroy tiny on close of the dialog and then recreate it on load again.

I tried to use remove but I get this error

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

So not sure what that is all about.


You should shut down tinymce correctly in order to be able to reinitialize a tinymce editor with the same id as the first one.

To shut down an edtor instance use:

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

To reinitialize use

tinymce.execCommand('mceAddControl',true,'editor_id');
0

精彩评论

暂无评论...
验证码 换一张
取 消