How to destroy tinyMce?

随声附和 提交于 2019-12-10 13:43:23

问题


I am using the latest 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.


回答1:


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');


来源:https://stackoverflow.com/questions/5162978/how-to-destroy-tinymce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!