'onkeydown' event fails

2 posts, 0 answers
  1. TERRY
    TERRY avatar
    12 posts
    Member since:
    Oct 2008

    Posted 30 Mar 2012 Link to this post

    We recently upgraded from 2011.1.519.40 to 2012.1.215.40.
    After the upgrade, it seems the 'onkeydown' event no longer works.
    Is there a problem with it?

    Code:

    <telerik:RadEditor CssClass="editor" ToolbarMode="ShowOnFocus" NewLineMode="Br" EditModes="All"

                                        ToolsFile="~/Setup/RadEditorSimpleTools.xml" ID="CaptionLabel"

                                        runat="server" Height="220" AutoResizeHeight="false" Width="400" onkeydown="alert('key down');"

                                        <CssFiles>

                                            <telerik:EditorCssFile  Value="EditorStyles.css" />

                                        </CssFiles>

                                        <Tools>

                                        <telerik:EditorToolGroup>

                                            <telerik:EditorSeparator />

                                            <telerik:EditorTool Name ="LinkManager" />

                                            <telerik:EditorTool Name ="Unlink" />

                                            </telerik:EditorToolGroup>

                                        </Tools>

                                    </telerik:RadEditor>


    In the above example the alert never shows our simple message.

    We did a workaround by adding the  "OnClientLoad" function attached to the same event -  onkeydown. For example:

     
     <Telerik:RadEditor  ..... OnClientLoad="OnClientLoad">

            function OnClientLoad(editor, args) {

                editor.attachEventHandler("onkeydown", function (e) { alert('key down attached from client load');

                });

            }

    But would prefer not to do this.  Is there some other reason the 'onkeydown' might not fire?
    Terry


  2. Rumen
    Admin
    Rumen avatar
    14366 posts

    Posted 03 Apr 2012 Link to this post

    Hello,

    This way for attaching to the onkeydown="alert('key down');" is not supported by RadEditor and the correct and supported way is shown in the following help article: attachEventHandler.

    Regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top