Row selection in reaction-virtualized

The documentation in virtualized react is not clear how row selection is handled. I need:

  • track the selected row
  • highlight the highlighted line
  • query which row is selected (I care about getting its data)

It looks like there is a way to handle click events on the line and change the style class for each line. I am guessing that I need to drop my own selection tracking based on these parameters. I hope I am wrong and there is a better way.

Than you

+3


source to share


1 answer


The concept of the selected line style or row of lines is not relevant to the window. It is part of the application code and should be tracked there - perhaps with React inline setState

.

react-virtualized doesn't have anything built in to do this because it is orthogonal to the purpose of the library, and I would not want to add bloat (in terms of byte size or maintenance effort) for functions that are not to the window.



I've created examples of how to do this sort of thing online, which you might find helpful. For example this slide (source code here ) for style selection.

+5


source







All Articles