0

( Using Sitecore 8 )

I have created a button in the Rich Text Editor and I want to translate the text from here into the page behind it. So to give the example, you click the button, the dialog pops up, you click on any of the values ( which get stored ) and then the insert button needs to be used to send those values into the Rich Text Editor box behind the dialog.

I have my xml file with the regular front end code:

<div class="fontBox">

<ul>
  <li>A</li>
  <li>B</li>
  <li>C</li>
  <li>D</li>
  <li>E</li>  
</ul>

</div>
Insert Icon

My .js looks like this:

$('.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

});

The Rich Text Editor is in the #EditorCenter ( td value ) with an iframe inside of it. How can you send text or values into the Rich Text Editor once I click on the button? I can't debug this so I don't know how Sitecore sends values to the Rich Text Editor from a dialog ( such as Insert Media ). All its doing right now is storing the variables and then closing the dialog without sending the values to the original Rich Text Editor. I'm sure it has to do something with the RadEditor, but at this point I'm guessing.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
Keith
  • 4,059
  • 2
  • 32
  • 56

1 Answers1

0

You can get a reference to RadEditor client object with the $find method and set its content through the set_html() method.

You can find more information in those topics: how to set the content to radeditor using javascript and Changing the value of a Telerik RadEditor with Javascript/jQuery

Community
  • 1
  • 1
Rumen Jekov
  • 1,665
  • 2
  • 17
  • 19