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

Editor: How to enable Tabulator inside the editor textbox

2 Answers 84 Views
Editor
This is a migrated thread and some comments may be shown as answers.
BigzampanoXXl
Top achievements
Rank 1
BigzampanoXXl asked on 14 May 2013, 02:49 PM
Hello,

I use the Editor control in my MVC application. I need to support the Tabulator key inside the Editor textbox.
When I press the Tabulator key, the Editor control looses the focues. But I need the support of the Tabulator key inside the Editor textbox.

Is there any "hack" or workaround to perform this action in the Editor textbox?

Greets

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 16 May 2013, 07:59 AM
Hi Dietmar,

 
You can attach keydown event handler to the body of the document inside the Editor Iframe element in which to prevent the event and execute your custom code. Please check the example below:

$(function () {
    $("iframe").contents().find("body").on("keydown", function (e) {
        if (e.keyCode == 9) {
            var editor = $("#editor").data("kendoEditor");
            editor.exec("inserthtml", { value: "  " });
            e.preventDefault();
        }
    })
})

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
BigzampanoXXl
Top achievements
Rank 1
answered on 17 May 2013, 07:21 AM
Thanks Vladimir, that worked fine.
Tags
Editor
Asked by
BigzampanoXXl
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
BigzampanoXXl
Top achievements
Rank 1
Share this question
or