Is it possible to only display a rich 开发者_Python百科text editor when the focus turns to a text area? I have a form with about 15 different text areas and i don't want each one displaying the editor tab when they are not in use.
Thanks
Yes, this is possible.
You will need to set the mode to "exact" in the tinymce init. Plus you will need to initialize the right tinymce editor when the textarea gets the focus.
$('#mytextarea').focus(function() {
alert('Handler for .focus() called.');
tinymce.execCommand('mceAddControl',true, $('#mytextarea').attr("id"));
});
To shut down an editor instance use:
tinymce.execCommand('mceRemoveControl',true, editor_id);
精彩评论