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

OnKeyup for Editor

3 Answers 68 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
nnk
Top achievements
Rank 1
nnk asked on 31 Dec 2010, 05:15 AM
Our project requires that we have a preview of what is typed into the editor control. With textarea we had a onkeyup event handler to address this. The OnEditorChange and onSelectionChange events are fired only when click outside of the editor.

Is there a way to simulate a onKeyup behavior in the editor?

3 Answers, 1 is accepted

Sort by
0
Makoto
Top achievements
Rank 1
answered on 28 Mar 2011, 06:50 PM
I'm trying to do something similar to this. I'd love to know if you found a solution, or if someone can post a solution.
0
Atanas Korchev
Telerik team
answered on 29 Mar 2011, 07:43 AM
Hi Makoto,

 You can use this JavaScript code to subscribe to the keydown event of the editor:

$($("#editor").data("tEditor").body).bind("keydown", function(e) {
    // your code here
} );

Replace "editor" with the name of your Editor component.

Greetings,
Atanas Korchev
the Telerik team
0
Fernando
Top achievements
Rank 1
answered on 10 Jul 2012, 06:31 PM
Hello,

we made this solution:
register the client event OnLoad:
.ClientEvents(e => e.OnLoad("onLoad"))

and the funcion onLoad:

function onLoad() {
$($("#editor").data("tEditor").body).bind("keypress", function(e) {
    // your code here
} );
}

Tks.
Tags
Editor
Asked by
nnk
Top achievements
Rank 1
Answers by
Makoto
Top achievements
Rank 1
Atanas Korchev
Telerik team
Fernando
Top achievements
Rank 1
Share this question
or