Editor: How to enable Tabulator inside the editor textbox

3 posts, 1 answers
  1. BigzampanoXXl
    BigzampanoXXl avatar
    60 posts
    Member since:
    Jan 2007

    Posted 14 May 2013 Link to this post

    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. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 16 May 2013 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. BigzampanoXXl
    BigzampanoXXl avatar
    60 posts
    Member since:
    Jan 2007

    Posted 17 May 2013 Link to this post

    Thanks Vladimir, that worked fine.
Back to Top