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

Rad editor fire command

1 Answer 100 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kranthi
Top achievements
Rank 1
Kranthi asked on 10 Feb 2016, 02:56 PM

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

 

 

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 Feb 2016, 12:49 PM
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
Tags
Editor
Asked by
Kranthi
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or