bencripps / react-redux-grid

A React Grid/Tree Component written in the Redux Pattern
http://react-redux-grid.herokuapp.com/
MIT License
446 stars 63 forks source link

Does react-redux-grid tree gridtype support paging? #203

Closed trevorgithub closed 6 years ago

trevorgithub commented 6 years ago

Hi,

I noticed that when working with a flat list, there is support for paging in the react-redux-grid control. Is paging supported when the grid type is set to tree?

Thank you!

bencripps commented 6 years ago

Currently, that is not supported :(

bencripps commented 6 years ago

I'm not sure the use case for paging a tree makes a whole lot of sense. Going to close this out. Please let me know if you have more info about why we'd want to support this?

trevorgithub commented 6 years ago

I would benefit from paging in the scenario where either a) the top level of the tree or b) any child node's direct children has a lot of breadth. Say, several thousands of nodes wide. In that case, lazy loading of child nodes on expand doesn't help because the tree would be loading a very large number of nodes at the same time -- either to populate the top level of the tree or to populate the many children of a just expanded node. The lazy loading helps where the tree doesn't have a lot of breadth, but can be very deep.

A virtualized dom (where all the content is not inserted into the dom on load, but rather when needed for viewing a particular portion of the tree) increases performance and decreases the memory footprint. But in case of a tree of wide breadth, without paging, even with a virtualized dom you're still loading a lot of data into some memory store on the browser (which is not the dom). This can take both a lot of memory in the browser and put a lot of pressure on the server to prepare that big chunk of data. Additionally, a lot data needs to be sent across the wire, in a single batch.

Paging would solve this problem, by loading a subset of the data as needed. As an alternative to paging, an infinite loading approach where more data is pulled in as the user scrolls would also work. Note that for this option to be successful, it would need to take a sliding window approach such that previously loaded content is eventually evicted from the browser memory cache. Failure to do so would result in too much memory being consumed as the user continues to scroll down.