prometheusresearch-archive / react-grid

MIT License
80 stars 20 forks source link

Row selection controllers #2

Open andreypopp opened 10 years ago

andreypopp commented 10 years ago

We need to implement row selection controllers which would allow different models for selecting rows in a grid.

Features we want (these can be ended up in different row selection controllers implementations though):

bakesteve commented 10 years ago

I've been trying out a few solutions to moving focus with keyboard navigation let me know if you had any thoughts on the right solution to this My initial proof of concept was to store ActiveCell : { cell: 0, row: 0 } in state and then pass this down didnt feel that neat, but the bulk of the approach can be seen here: https://github.com/adazzle/react-grid/commit/15edb336aff4105cac1388ac0b6adcb0b950242a

and its designed from an excel-style grid point of view, so wont cope with multiple selections, etc (though shouldn't be hard to extend that)

Also - for mouse selection of a cell, this will require the click handler to be aware of the row and cell indexes, and then pass this upto the owner of the grid state. So maybe a neater approach would be for the state of selection to be owned within a selection controller? The issue there that stopped em going down that path is that you would probably want to do a few of the following: