ForeColor tool

2 posts, 0 answers
  1. Kiran
    Kiran avatar
    4 posts
    Member since:
    Aug 2011

    Posted 20 Nov 2012 Link to this post

     Please tell me how to attach a handler to the ColorChange event of the ForeColor tool in Radeditor.
     The following script I have is not picking up the ForeColor tool using  $find(editor.get_id() + "_ForeColor");

    Also please let me know the event name corresponding to the color change. Is it add_colorChange?


    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad" ToolsFile="~/Tools/ToolsFile.xml" Width="100%" Height="645"


    ContentFilters="RemoveScripts, FixUlBoldItalic, FixEnclosingP, IECleanAnchors, MozEmStrong, ConvertFontToSpan, IndentHTMLContent, EncodeScripts, OptimizeSpans, ConvertCharactersToEntities">







    <script type="text/javascript">  


    function OnClientLoad(editor) {


    forePicker = $find(editor.get_id() + "_ForeColor");


    function(sender, args) { 

    var color = sender.get_selectedColor(); 

    sender.get_element().style.borderColor = color ? color : "transparent";"ForeColor", { value: color });});







  2. Rumen
    Rumen avatar
    14323 posts

    Posted 20 Nov 2012 Link to this post


    The OnClientLoad event is executed only when the editor is loaded on the page. You need to attach to the OnClientCommandExecuting which is fired when some command is executed. See this forum thread for more information: Add Custom Color.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top