开发者

TinyMCE fields turning blank after reentering panel jQuery UI Tab

I am using jQuery UI tabs, so there are different panels loaded by ajax.

Now I have one panel, which contains many textfields.

It contains one textfield, which need to be transformed into a tinymce editor in editing mode.This one is available to make new notes.

(this works by using tinyMCE.execCommand('mceAddControl- and mceRemoveControl)

In the same tab I have a list of all the notes.开发者_StackOverflow社区 They are in read only mode. The first time when I press this panel everything is displayed correctly.

To init these textfields I use this code

    tinyMCE.init({
    mode : "specific_textareas",
    theme : "advanced",
    editor_selector : "mceRead",
    readonly:true
    });

When I enter another panel, and reenter the panel which contains these texareas, all the read only tinymce fields turn blank. I think it is because I'm not using tinyMCE.execCommand(mceRemoveControl). I don't know how to solve this because these are many textareas, and they are initialized by class, not by id.

Anybody knows how I can avoid these tinymce fields turning blank after reentering this panel?


I think it is because I'm not using tinyMCE.execCommand(mceRemoveControl).

This is correct. You need to removeControl and addControl when you get back. Even if you initialized the tinymce instances using classes they get the textarea id assigned as editorid. That way you are able to shut them down correctly (the editor instances can be found using tinymce.editors).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜