aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 137 forks source link

move to the next / previous row using up and down arrows #400

Open abate opened 8 years ago

abate commented 8 years ago

I've a large table and I'd love to select the next and previous row using the up/down keys on my keyboard. Using mousetrap is not difficult to bind an action to a keypress, but I'm a bit lost on the reactive-table side. how can I store the current row number and select the next ? I guess I need some kind of cursor / state I can navigate. Is there already something built in ? Or I've to do this manually ?

And if I've to do it myself, can you suggest the best way to proceed ?

aslagle commented 8 years ago

The package doesn't have any keyboard controls or any kind of state already.

There's no info at the tr level that's accessible outside the package, so I think you'd have to put the row id in a hidden html attribute in one of the cells, and then store that id somewhere.