Rad editor fire command

2 posts, 0 answers
  1. Kranthi
    Kranthi  avatar
    1 posts
    Member since:
    Oct 2012

    Posted 10 Feb Link to this post

    Hi,
    My query is regarding Rad Editor.
    The problem is when I create a custom commands in rad editor to apply styles to content as font size, font type etc.,.
    But at the same when I try to apply CSS class to content it is not working for me.
    Below is my Code


    Below is the code working

    EditorCommandList["Mandatory"] = function (commandName, editor, args) {

                if (editor.getSelectionHtml() != "") {
                    editor.fire("FontSize", { value: "40" });
    }
    }

    Below is the code not working

    EditorCommandList["GuideLines"] = function (commandName, editor, args) {

                if (editor.getSelectionHtml() != "") {

                    editor.fire("ApplyClass", { value: "radGuideLines " });

    }
    }

    In the above code when i try apply a class using "ApplyClass" command it is not working.

    Please provide me solution ASAP.

     

    Thanks

     

     

  2. Nikolay
    Admin
    Nikolay avatar
    64 posts

    Posted 12 Feb Link to this post

    Hi,

    I have debugged this and found out that ApplyClass command expects a EditorCommandEventArgs object parameter instead of json. Please try the following:
    editor.fire("ApplyClass", new Telerik.Web.UI.EditorCommandEventArgs("ApplyClass", null, "radGuideLines "))

    Regards,
    Nikolay
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top