Changing tab order from left to right to top to bottom

I’m attempting to make a grid layout where columns become rows and rows become columns, or a pivot. Once the pivot is performed how can i make a keypress of “tab” move down to the next row, rather than right to the next column. Basically the table would go from this:



a b c

d e f

g h i



to this…



a d g

b e h

c f i

If you need to change the way how tab key works, it can be done by using onKeyPress event, or direct changes in keymap

grid = new …

grid._key_events.k9_0_0=function(){

//any code here, which will select next necessary cell

};

awesome!  thanks