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

[Solved] RadEditor - Capture TAB or SHIFT+TAB

1 Answer 202 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 May 2008, 03:02 PM

In reading through the posts it appears that when using RadWindow (Modal), in order to prevent the User from ‘Tabbing’ off of the window and getting back to the underlying page you must implement some custom JS code.  Not sure if this is the best solution, but what I have done is;

  • Attached code to the ‘onkeydown’ events of the First and Last controls on the page.
  • When the Focus arrives at the control via ‘tabbing’ I can test/capture the event and send them to the correct control on the window.
  •  This basically creates a cycle or loop that keeps the User on the form yet allows expected ‘tabbing’ behavior in the UI.

 My issue is I have a Page that has RadEditors as the First and Last controls on the page. How can I capture key events and control the Focus?

  • Using RadWindow, Modal=True
  • Have the following Control on the Page in this order;
  • RadEditor1 (User can Input Data here). Enable Tab=False
  • Cancel Button ,  Update Button
  • RadEditor2 (Displays Historical Data, Read-Only).  Enable Tab=False

     So when the page loads, the Focus is set to RadEditor1. If the User starts pressing the TAB key the Focus goes to;

    • Cancel Button
    • Update Button
    • RadEditor2
    • Then leaves the Page.

    Any help would be appreciated. Thank you.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 May 2008, 01:07 PM
Hello Michael B.,

You can find how to attach to the onkeydown event of RadEditor in the following help article: attachEventHandler. Once you attach your code to the onkeydown event, check whether the Tab key is pressed and programmatically set the focus to the next element after the editor.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Michael
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or