Open JulienLaclaverie opened 7 years ago
any update here? I get Uncaught TypeError: pe[a].exec is not a function when trying to use multiple instances of tinymce
Instead of using the execCommand, I was able to do this using init and remove options, as follows.
var tinymceOptions = {
plugins: 'lists advlist link paste autolink',
toolbar: 'fontselect fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | link',
menubar: false,
branding: false,
paste_data_images: false,
isLoaded: false,
};
function initTinyMCE(inputTagId){
var tinymce_options = tinymceOptions;
tinymce_options.selector = '#' + inputTagId;
tinymce.init(tinymce_options);
}
function removeTinyMCE(inputTagId){
tinymce.remove('#' + inputTagId);
}
Note that I am using the selector option instead the setup option to set the exact DOM element which I need to be initiated as a TinyMCE editor. Hope this helps.
Hello,
I need some guidance here, I'm trying to load a page with multiple text-area on it, but only load the tinyMCE on a specifyed textarea when it's needed.
To do so, TinyMCE gives access to this function :
tinymce.execCommand('mceAddEditor',false,'MyTextareaId');
But to use
execCommand
with ui-tinymce works just once, I have this :So this works, but only once and I can have 1 to 15 textarea to maybe change into a tinymce. How can I do this dynamically, is this even possible with ui-tinymce ?