开发者

Gridview Navigation through keyboard with the help of javascript

suppose my gridview has 5 column and 10 rows. each column has textbox. when focus is in first textbox of first row then i want that if user press right arrow key the focus will move to next textbox in first row second column. when user will press down arrow then focus will move to te开发者_如何学编程xtbox which is in the 2nd row and 2nd column. i could i achieve this by javascript. please give me concept which will be generic and that can be use in any page of same scenario. thanks.


My Calctastic library uses this for inputs in HTML tables. (See example 2.) This is accomplished through the use of my Grid Navigation library, which leans on some very old cross-browser code.

At some point I will update this to use jQuery; until then you are welcome to take and modify the code as you like.

Note that I explicitly do not support (or recommend) right/left navigation using the arrow keys. Users need to use arrow keys to move the caret while editing text. If you hijack the right arrow key to move to the right input, it's going to be very confusing and annoying.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜