简体   繁体   English

tinymce-如何将焦点设置到具有多个编辑器的页面上的第一个编辑器?

[英]tinymce - how to set the focus to the first editor on a page with multiple editors?

if I have more than one tinymce editor on a page, every action I do goes to the last editor unless I explicitly click on the editor I want to edit. 如果页面上有多个tinymce编辑器,则除非我明确单击要编辑的编辑器,否则我执行的每个操作都会转到最后一个编辑器。 For example, I made a plugin, which displays a dialog box, I type something in the dialog box and it should go to the first editor (I launch the dialog box from the first editor) but it goes to the last one, as it is the currently active editor. 例如,我制作了一个插件,该插件显示一个对话框,在对话框中键入内容,它应该转到第一个编辑器(我从第一个编辑器启动对话框),但是转到最后一个编辑器,因为它是当前活动的编辑器。

How do I make the first editor active, once the page is loaded? 页面加载后,如何激活第一个编辑器?

If you have multiple tinyMCE forms on one page, I recommend 如果您在一页上有多个tinyMCE表单,我建议
Command: runScript 命令:runScript
Target: tinyMCE.get('textarea_id').setContent('Your Text') 目标:tinyMCE.get('textarea_id')。setContent('Your Text')

try this 尝试这个

tinyMCE.execInstanceCommand("mce_editor_0", "mceFocus");

taken from here 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM