1
votes

I have TinMCE installed and now I would like to invoke the preview functionality from outside the editor. I mean when another preview button in clicked, it needs to invoke the tinymce preview so that I can see the preview popup. This is possible ?

2

2 Answers

3
votes

Try to follow this fiddle

Create a button outside editor. Invoke this command onclick of this button.

 tinyMCE.activeEditor.execCommand('mcePreview');

Hope this helps.

0
votes

Try with a syntax like that for grab the content:

var content = tinyMCE.activeEditor.getContent();

Or for the preview:

$('textarea.tinymce').tinymce().execCommand('mcePreview');