Topic: TinyMCE in a jQuery UI Dialog - Cannot type
Have been trying to fix this for a while now.
I am trying to load a number of TinyMCE editors inside a jQuery UI Dialog (http://www.ui.jquery.com/ + http://docs.jquery.com/UI/Dialog). The editors load without problems, but I cannot type anything into them, and if I click on any of the buttons (Bold, Italic etc) I get the following error: 't.win.document has no properties'. There is a similar problem in FCKeditor, in which the editor doesn't work properly if it starts life in a hidden DIV. The TinyMCE instances I am creating must start in a hidden DIV, so I'm hoping there is a workaround.
So, I had a search on these forums and discovered that I could add/remove TinyMCE instances dynamically, using the following:
called during a 'dialog open' callback function: tinyMCE.execCommand('mceAddControl',false,'txt_notesone'); and the following called during a 'dialog close' callback function: tinyMCE.execCommand('mceRemoveControl',false,'txt_notesone');
However, this will work the first time the dialog is opened, with the TinyMCE instances being created once the dialog is open. Ugly, but functional. However, I cannot get it to work on subsequent opening of the dialog.
I tried wrapping the TinyMCE-affected textareas in uniquely identified DIVs, and then removed them (after the execCommand('mceRemoveControl')) and placed a brand new textarea inside the DIV with the same ID as the previous one. This doesn't seem to work either. The new textareas never get converted into TinyMCE instances in this case.
As I said, the TinyMCE instances appear OK, but they do not work. I cannot type anything, nothing will load into them, and the buttons all give me errors.
PS I'm using Firefox (currently 188.8.131.52), which is the target browser platform (cannot be changed due to client requirements).
Many thanks in advance for any advice on this,
- Nils Luxton