kendo grid - KendoGrid popup edit window, Form field set focus using jquery -


context: kendogrid editing set popup. opens popup window fields in it, in case template editing window custom js logic etc. tabindex values have been set fields in order want , autofocus set on first field. have custom js runs on edit event of grid position , size window when pops open: function editwindowlocation(e)

observation: relatively simple js code if form , fields static doing like: document.formname.fieldname.focus();

problem: after window pops open, new window has focus. when tab key pressed, sends focus buttons on window (update/cancel) more tabbing later, reaches fields. how first field in popup window focus, tabbing set focus other fields in order index set?

solution: @ end of function editwindowlocation(e) added little bit of code find first tabindex , set focus it.

settimeout(function () {     $("input[tabindex=1]").focus(); }, 1000); 

why timeout say? kendowindow somehow overriding .focus() event , placing focus on div makes kendowindow. when done in timeout, works expected. not sure why happens, worked me.

hope helps people similar issues.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -