TextBox focus when window opens

1 Answer 54 Views
TextBox Window
Stefan
Top achievements
Rank 1
Iron
Iron
Iron
Stefan asked on 24 Jul 2024, 01:27 PM

Hi,

 

how to set focus to kendo TextBox widget when a kendo window opens?

I tried the following but no luck. The widget is selected and focused for a fraction of second and then selection and focus is magically removed.



   $(document).ready(function () {
       setTimeout(function () { $("#position").data("kendoTextBox").focus() }, 200)
   });

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 29 Jul 2024, 08:19 AM

Hello, Stefan,

Here you will find a small example on how to focus the TextBox in the open event of the Window. You will need to set a bigger value for the timeout so that the open animation of the Window is completed before the focus method is executed.

Let me know if that would be helpful.

Regards,
Martin
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Tags
TextBox Window
Asked by
Stefan
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Martin
Telerik team
Share this question
or