Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command identifiers for tinymce 4.x (mceAddControl)

I am migrating from tinyMCE 3.x to the latest version of tinyMCE 4.x. My problem is that I have dynamic generation of tinyMCE instances so in 3.x I was using:

tinymce.EditorManager.execCommand('mceAddControl', true, "content_txt");

but in version 4.x this doesn't work. I started to check the documentation but I can't find the identifiers for version 4.x

like image 337
cyrat Avatar asked Mar 23 '23 17:03

cyrat


2 Answers

Migration is very simple, replace

tinymce.EditorManager.execCommand('mceAddControl', true, "content_txt");

by

tinymce.EditorManager.execCommand('mceAddEditor', true, "content_txt");

When you want to turn it of, you can use

tinymce.EditorManager.execCommand('mceRemoveEditor', false, "content_txt");
like image 71
StanleyD Avatar answered Mar 25 '23 05:03

StanleyD


Use mceRemoveEditor/mceAddEditor exactly the same commands as stated here http://www.tinymce.com/forum/viewtopic.php?id=31256

like image 42
Iain H. Avatar answered Mar 25 '23 06:03

Iain H.