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

How to set focus on required field for list view

1 Answer 346 Views
ListView
This is a migrated thread and some comments may be shown as answers.
charan
Top achievements
Rank 1
charan asked on 25 Jun 2012, 09:25 AM
hi,
I have a list view.Inside that i have different fields including text boxes and drop downs.when i select edit mode the focus going to the first field that is text box in my case.I want to set the focus in which ever field i click on,but not on first field by default.Is setting the focus on required field is possible for List view.
Please suggest me any sample or example on how to do this

Thanks

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 27 Jun 2012, 11:45 AM
Hello Charan,

To achieve this you could hook up to the edit event of the ListView and then set the focus() to the required field. For example: 
$("#listView").kendoListView({
   edit: function(e){
     $(e.item).find("input: eq(1)").focus();
   },
 //....
})

For convenience, I prepared a small example which illustrates such approach in action.

 

Greetings,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView
Asked by
charan
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or