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

[Solved] Tabbing in HTML Mode

1 Answer 144 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Brian Doner
Top achievements
Rank 1
Brian Doner asked on 05 Jun 2009, 01:38 AM
Hi, in the Classic radEditor, when you go to HTML mode, you can tab lines over to indent. But in this version of radEditor, that doesn't seem to be possible. Tabbing just sets the focus on the next element within the editor. Is there something I have to do to make that work? In the Classic version, it worked by default. Thanks.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 Jun 2009, 03:05 PM
Hello Brian,

You can use the code below to enable the Tabbing feature inside Html mode of RadEditor for ASP.NET AJAX:
<script type="text/javascript"
function OnClientModeChange(editor) 
    var mode = editor.get_mode(); 
    if (mode == 2) 
    { 
        var textarea = editor.get_textArea(); 
        if ($telerik.isIE) 
        { 
            textarea.attachEvent("onkeydown", InsertTab); 
        } 
        else 
        { 
            textarea.addEventListener("keydown", InsertTab, false); 
        } 
    } 
     
    function InsertTab(eventArgs) 
    { 
        var KeyID = eventArgs.keyCode; 
        if (KeyID == 9) 
        { 
            editor.pasteHtml("&nbsp;&nbsp;&nbsp;&nbsp;"); 
            $telerik.cancelRawEvent(eventArgs); 
            return false
        } 
    } 
</script> 
<telerik:RadEditor runat="server" 
    OnClientModeChange="OnClientModeChange" 
    ImageManager-ViewPaths="~/" 
    ID="RadEditor1"
</telerik:RadEditor> 

For your convenience I have attached my test page.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Brian Doner
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or