如何破坏tinyMce? [英] How to destroy tinyMce?

查看:70
本文介绍了如何破坏tinyMce?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是最新版本3.4.b3。我在一个对话框中有它,它的内容是动态创建的。

I am using the latest version 3.4.b3. I have it in a dialog and it's contents are created dynamically.

所以这意味着每个时刻都会创建一个很小的应该绑定自己的textarea。因此,当我第一次加载对话框时,微小的显示。如果我第二次加载对话框,对话框就不会再出现了。

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.

所以我认为我需要在对话框结束时销毁tiny,然后重新创建它再次加载。

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

所以不确定那是什么。

推荐答案

你应该正确关闭tinymce才能成为能够重新初始化具有与第一个相同ID的tinymce编辑器。

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

重新初始化使用

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

这篇关于如何破坏tinyMce?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆