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

'onkeydown' event fails

1 Answer 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
TERRY
Top achievements
Rank 1
TERRY asked on 31 Mar 2012, 01:33 AM
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:

 

        function OnClientLoad(editor, args) {

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

            });

        }


1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Apr 2012, 12:21 PM
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.
Tags
Editor
Asked by
TERRY
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or