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

[Solved] RTL LTR buttons, is where better way to do it?

0 Answers 9 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
andrey
Top achievements
Rank 1
andrey asked on 24 Mar 2012, 06:40 PM
Hello,
I need RTL LTR buttons in editor.

I did simple insertHtml of "p" element.

 Is there better way to do it?

    Html.Telerik().EditorFor(model => model)
        .Tools(tools => tools
            .Custom(settings => settings.HtmlAttributes(new
            {
                @class = "t-rtl",
                onclick =
                    "textRTL()"
            }))
            .Custom(settings => settings.HtmlAttributes(new
            {
                @class = "t-ltr",
                onclick =
                    "textLTR()"
            }))
        )
        .Render();
}


function textRTL() {
    var editor = $('#editor').data("tEditor");
    editor.exec('insertHtml', {value:'<p dir="rtl">rtl text here</p>'});
    editor.update();
}
function textLTR() {
    var editor = $('#editor').data("tEditor");
    editor.exec('insertHtml', {value:'<p dir="rtl">rtl text here</p>'});
    editor.update();
}


Tags
Editor
Asked by
andrey
Top achievements
Rank 1
Share this question
or