css - How to Implement Virtualization with Sticky Header and Sidebar Using @tanstackreact-virtual? - Stack Overflow

I am using @tanstackreact-virtual (useVirtualizer) to optimize rendering for a large dataset. My data

I am using @tanstack/react-virtual (useVirtualizer) to optimize rendering for a large dataset. My data consists of reports for 200 employees over 365 days, displayed in a CSS Grid.

Requirements: Sticky Header: The top row contains headings (not part of the employee data) and should remain fixed when scrolling vertically.

Sticky Sidebar: The first column contains employee names and should remain fixed when scrolling horizontally. This sidebar is wider than the other columns.

Performance Optimization: Since rendering such a large dataset is costly, I want to implement virtualization while maintaining the sticky header and sidebar.

Issues Encountered: How should I structure my layout to efficiently use @tanstack/react-virtual while keeping the header and sidebar sticky?

Should I use multiple virtualizers (one for rows, one for columns)?

What is the best approach to sync scrolling between the main data grid and the sticky elements?

What would be the best way to approach this? Any guidance or code examples would be greatly appreciated!

here is the image example i currently have using css grid

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744254998a4565352.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信