I have a button, which loads a form when clicked, and another cancel button, which removes the form from dom. When the form is inserted, the textarea is initialized with TinyMCE and it works fine. But after I click cancel, and then load the form for the second time, it doesn't work. I am using TinyMCE 4 and couldn't find a solution anywhere. I am using this:
tinymce.init({
selector: "#testarea",
menubar: false,
statusbar: false
});
This is what I've tried:
$.ajax(
// ajax call
).done(function(e) {
tinymce.init({
selector: "#testarea",
menubar: false,
statusbar: false
});
});
So, as you can see, I tried reinitializing the plugin after the new content loads with ajax, but it doesn't work.
Any help would be appreciated.