Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Virtualized - Nested WindowScroller/List

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.

like image 551
jerpsu15 Avatar asked Sep 13 '18 04:09

jerpsu15


1 Answers

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.

like image 186
Jacob K Avatar answered Nov 09 '22 11:11

Jacob K