15

I'm trying to used react-virtualized to render a table with 1000+ rows of data. The rows are very heavy containing multiple complex React components. input, combobox, date selector and popup menus all in one single row. I need the entire window to scroll these rows.

I also need to group the rows and nest them into a show/hide style accordion component.

[+] Row Header 1
    row 1
    row 2
    ...
    row 1001
[+] Row Header 2
    row 1
    row 2
    ...
    row 1001

I'm unsure how to handle this use case or if React-Virtualized can handle this type of thing.

What I've tried:

Use WindowScroller/AutoSizer/List components in conjunction and place this group of react-virtualized components into each of the accordions. This works but does not solve my perf. issues because it's still too much for the browser to handle (first load is around 25 seconds and scrolling isn't usable)

Do I also need to use WindowScroller/AutoSizer/List components to handle the first level of Row Headers as well?

Any ideas or examples would be much appreciated.

jerpsu15
  • 161
  • 2
  • 5
  • On the same issue right now. Have you find a nice solution to share? Currently thinking about two possible options: 1) using virtualized Grids on each level (Grid for groups and a grid for subItems when the row is expanded) 2) use only one virtualized grid, prepare my data to tree-like structure and just change rowCount when expanding items – Mike Yermolayev Nov 27 '19 at 12:20
  • Do you need to display all of those components, or you only have a header that will later be expanded showing the complex component structure? – Ivan Satsiuk Jan 14 '21 at 18:20

1 Answers1

0

You can at least free up the UI thread for scrolling (of course an important UX principle) with web workers.

Here is a medium-length discussion article with an example, a quick implementation doc (and the great matching article), and my all-time favorite talk on the subject.

This defers the effort from the main "UI" thread, but you can also prevent this deferment in the first place if the effort can be memoized with the useMemo() hook.

Jacob K
  • 138
  • 5