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

Set focus after click event

1 Answer 279 Views
Button
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 25 Mar 2014, 08:46 PM
I have a Kendo button with the click event defined as:

@(Html.Kendo().Button()
                    .Name("btnAddNewLineItem")
                    .Tag("span")
                    .Icon("plus")
                    .Content(@InvSubModule.Infrastructure.Localization.ResourceManager.GetString("AddNew") +"   " + "<span></span>")
                    .HtmlAttributes( new {type = "button"} )
                    .Events(ev => ev.Click("AddLineItemButtonRequest"))                 
                )   

In my JavaScript method: "AddLineItemButtonRequest", the last line sets the focus to another control on the page via jQuery:

$("#LineItemType").focus();

However, after this line, the focus is shifted back to the Kendo button above. Is there another way I should be setting the focus?

Thanks for your time,
Scott Dulock


1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 26 Mar 2014, 08:36 AM
Hello Scott,


I tried to reproduce the issue on my side, but to no avail. Here is a runnable example, using the web version of the Button widget, which demonstrates a similar scenario - focusing another element in the click event handler.

Please let me know if I am missing something. If the problem is still persisting, could you send me a runnable example, in which it is reproducing, so I could assist you further?

Regards,
Dimiter Madjarov
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Button
Asked by
Scott
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or