This is a migrated thread and some comments may be shown as answers.

[Solved] How to let the user set style for the whole text?

1 Answer 63 Views
Editor
This is a migrated thread and some comments may be shown as answers.
fquinty
Top achievements
Rank 1
fquinty asked on 27 Jun 2009, 08:55 AM
Hello,

A user can change font/color/background-color of the selected text.

But do you provide a button/tool for a user to change the font/color/background-color of the whole text in the radEditor? I do not mean changing the appearance of the Iframe using CSS, but the apperance of the text returned after a Postback/Callback of the RadEditor.

It can be like adding a body tag with style around the html code.

Thanks for your help

Regards,

Frank Quinty

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Jul 2009, 02:28 PM
Hi Frank,

Please, check the following example Custom Tools, which demonstrates how to create a custom button that will apply formatting to the selected content. You can enhance its code to select the whole content before applying the formatting by firing editor.fire("SelectAll") command, e.g.

<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList[
"ApplySizeColor"] = function(commandName, editor, args)
{
     editor.fire("SelectAll");
     editor.fire("FontSize", {value : "4"}); //fire the FontSize command
     
editor.fire("ForeColor", {value : "red"});  //fire the ForeColor command
};
</script>

I hope this helps.


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
fquinty
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or