When i ran mceRemoveControl command to remove a already destroyed tinymce on a textarea,
i get NS_ERROR_UNEXPECTED.
After googling around with not much result, ive decided to dig into the source code ,
and finally found a solution.
Instead of calling directly mceRemoveControl, call this tinyMCE.remove(tinyMCE.getInstanceById()):
var oInstance = tinyMCE.getInstanceById("txtContent");
if (oInstance) {
if (oInstance.isHidden()) tinyMCE.remove(oInstance);
tinyMCE.execCommand('mceRemoveControl', true, "txtContent");
}
tinyMCE.execCommand('mceAddControl', true, "txtContent");
tinyMCE.remove(tinyMCE.getInstanceById("txtContent"))
tinyMCE.remove(tinyMCE.getInstanceById("txtContent"))
7 comments:
Thank you! I ran into this problem today -- and this fixed it.
great ;)
Awesome!.....Really Great...Thank you
Thank you!
Excellent job.
You, sir, deserve a trophy! Thank you!
You, sir, deserve a trophy! Thank you!
Post a Comment