【发布时间】:2016-10-24 21:00:54
【问题描述】:
(使用 Sitecore 8)
我在富文本编辑器中创建了一个按钮,我想将此处的文本翻译到它后面的页面中。所以举个例子,你点击按钮,弹出对话框,点击任何值(被存储),然后需要使用插入按钮将这些值发送到对话框后面的富文本编辑器框中.
我的 xml 文件带有常规前端代码:
<div class="fontBox">
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
</ul>
</div>
插入图标
我的 .js 看起来像这样:
$('.fontBox ul li').on('click', function () {
$(this).toggleClass('selected');
});
$('#OKButton').on('click', function () {
var vSelect = $('.selected').text(); // this stores the values of every .selected li
$('.scStretch #Editor_contentIframe body').text(vSelect); // here is where I'm trying to take the values and write them
scCancel(); // this closes the dialog box after executing
});
富文本编辑器位于 #EditorCenter ( td value ) 中,其中包含一个 iframe。单击按钮后,如何将文本或值发送到富文本编辑器?我无法对此进行调试,因此我不知道 Sitecore 如何通过对话框(例如 Insert Media )将值发送到富文本编辑器。它现在所做的只是存储变量,然后关闭对话框而不将值发送到原始富文本编辑器。我确信它与 RadEditor 有关系,但目前我猜。
【问题讨论】:
标签: jquery dialog sitecore sitecore8