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

Set focus on first input in new row

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stéphan Parrot
Top achievements
Rank 1
Stéphan Parrot asked on 14 May 2010, 03:47 PM
Hello people,
     I'm using the client-side javascript addRow() of the Grid's API and, when the new row gets shown in the Grid, I'd like to set the focus on the first input box in the new row.
Can someone point me out a solution for this? I've tried many things but, so far, no luck...


Thanks!

1 Answer, 1 is accepted

Sort by
0
Stéphan Parrot
Top achievements
Rank 1
answered on 14 May 2010, 06:09 PM
Got it working!
Add this to your MVC view:

<%

Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>

{

%>

    $(".t-grid-action.t-button").live('click', function () { $(".text-box").first().focus(); });

<%

});

%>

Hope this help someone out there!

Stéphan

Tags
Grid
Asked by
Stéphan Parrot
Top achievements
Rank 1
Answers by
Stéphan Parrot
Top achievements
Rank 1
Share this question
or