1

Topic: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

Hi,
I have tabs in ajax (removing and adding textarea), and mceRemoveControl and mceAddControl isn't in tinymce 4.
How to re-activate the editor in tinymce 4?

Thx.

Last edited by algodata (2013-06-13 17:32:07)

2

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

Use mceRemoveEditor/mceAddEditor.

Best regards,
Spocke - Main developer of TinyMCE

3

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

they do not exist for tinymce version 4.

4

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

Got removed in the cleanup. Use mceRemoveEditor/mceAddEditor exactly the same commands.

Best regards,
Spocke - Main developer of TinyMCE

5

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

Sorry I didn't see the changing.
Thx, it works:)

6

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

I tried mceAddEditor and it works but loads default tinymce settings and not the ones that have been setup for other existing tinymce textareas.

FYI, I am using the jquery version of tinymce.

Any help on this will be highly appreciated

Kind Regards,
Pratik

7

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

I am having the same problem as pratik.thakkar.

i use this line to remove an editor:
tinymce.EditorManager.execCommand('mceRemoveEditor', false, "#reply_text");

i then use this line to re-add an editor:
tinymce.EditorManager.execCommand('mceAddEditor', false, "#reply_text");

but the added editor is broken (cannot accept focus, cannot accept typed characters) and also is blank white (ignoring my css configuration).  Does anyone know what might be causing this?

Last edited by vecima (2014-04-27 21:08:57)

8

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

Here the same question. I remove and add the editor with

tinyMCE.execCommand('mceFocus', false, 'editor_id');
tinyMCE.execCommand('mceRemoveEditor', false, 'editor_id');
tinyMCE.execCommand('mceAddEditor', false, 'editor_id');

result, a new editor with:

* cannot accept focus
* cannot accept typed characters
* blank white edit field

what can I do? I use tinyMCE 4.2.1

Last edited by Editorant (2015-07-14 11:56:51)

9

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

I have the same problem.

Is there already a solution? it is bin two months. This is a really annoying bug

10

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

I don't see a problem here use the tinymce.init and tinymce.remove API calls to create/remove editors. Also remember that the init operation is async so you can't focus until you get the init event.

Best regards,
Spocke - Main developer of TinyMCE

11

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

i get the same issue if I use init(), there is one editor that is ok, the other has now content, and is disabled.

12

Re: [Resolved] mceRemoveControl and mceAddControl in tinymce 4

If the tab/dialog script modifies the dom by cloning the iframe that some scripts out there do. Then the iframe state is blown away and the editor becomes unresponsive this is a browser/implementation issue not an issue with tinymce.

So use tinymce.init to initialize editors, if the element that has the editor is removed call tinymce.remove and then tinymce.init when that element exists again.

If you feel it's a bug report it in the bug tracker with a fiddle on created on fiddle.tinymce.com and we will look into it.

Best regards,
Spocke - Main developer of TinyMCE