(使用Sitecore 8)
我已经在富文本编辑器中创建了一个按钮,并希望将文本从此处转换到它后面的页面中。因此,为了给出示例,您单击按钮,弹出对话框,单击任何值(存储),然后需要使用insert按钮将这些值发送到对话框后面的Rich Text Editor框中。
我有一个包含常规前端代码的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值)中,其中包含一个iframe。单击该按钮后,如何将文本或值发送到富文本编辑器中?我不能对此进行调试,所以我不知道Sitecore如何将值从对话框(如插入媒体)发送到富文本编辑器。它现在所做的就是存储变量,然后关闭对话框,而不将值发送到原始的Rich Text Editor。我确定它一定与RadEditor有关,但在这一点上,我猜。
发布于 2016-09-29 16:19:02
您可以使用the $find method获取对RadEditor客户端对象的引用,并通过set_html()方法设置其内容。
您可以在以下主题中找到更多信息:how to set the content to radeditor using javascript和Changing the value of a Telerik RadEditor with Javascript/jQuery
https://stackoverflow.com/questions/37976166
复制相似问题