I am currently struggling to get a FancyBox popup to work with a few embedded tinyMCE text areas. I have looked all over the internet, including pretty much every post on here and remain unsuccessful.
The FancyBox will load correctly and display the multiple tinyMCE text areas (the button toolbars all display correctly). The problem is that it will not actually display any text in the textboxes, and the actual text box is not editable.
My tinyMCE init code is:
tinyMCE.init({
theme : "advanced",
mode : "exact",
elements : "Cause",
// Theme options - button# indicated the row# only
theme_advanced_buttons1: "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,outdent,indent,separator,undo,redo",
theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,separator,code,separator,radspell",
theme_advanced_buttons3: "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "none"
});
And my call to FancyBox is:
$('#PopupAdd').fancybox({
titlePosition: 'none',
autoscale: false,
showCloseButton: false,
centerOnScroll: false,
onComplete: function () {
tinyMCE.execCommand('mceAddControl',true,'Cause');
},
onCleanup: function () {
tinyMCE.EditorManager.execCommand('mceRemoveControl', true, 'Cause');
}
});
I have tried nearly every variation of the above code I can think of. If anyone has any new ideas as to how to approach this, it would be greatly appreciated!
Update:
My HTML is:
<lcmp:LittleButton ID="AddStatusButton" Tooltip="Add a new Status." OnClick="addStatusPopup(); return false;" />
Which creates a button that when clicked calls
function addStatusPopup()
{
$('#PopupAdd').trigger('click');
}