javascript - Angularjs fastest way to find next td vertically in a big table -


i have special grid directive has lots of rows , can't paginated. each td has text input, on "enter key press" input below should focused(the input in td in next row same column).

this using right :

if (e.keycode == 13) {//enter     input.blur();     var row = td.parent();     var nextrow = row.next();     if (nextrow.length)         nextrow.children().eq(td.index()).find('input').focus();     else {         row.parent()//tbody             .children().eq(0)//first row             .children().eq(td.index() + 1)//next column             .find('input').focus();     } } 

is there faster way this? maybe pure js or full jquery ?


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -