Skip to content

support dynamic height rows for non-virtualized rendering#4040

Open
fastfrwrd wants to merge 5 commits into
Comcast:mainfrom
grafana:dynamic-height-rows
Open

support dynamic height rows for non-virtualized rendering#4040
fastfrwrd wants to merge 5 commits into
Comcast:mainfrom
grafana:dynamic-height-rows

Conversation

@fastfrwrd
Copy link
Copy Markdown

Summary

  • adds an option to use a string for rowHeight, which can be set to keyword values like auto, fit-content, stretch, etc.
  • updates useViewportRows to handle this, which adds new required new props element and gridHeight when using a string-based height.
  • updates page up and page down to handle this.
  • when using a string-based height, obviously the rowHeight calculations required for virtualization are not possible, so virtualization is disabled by default when using string rowHeights, and an error is thrown if you attempt to force virtualization on with rowHeights set to a string value.

Background

At Grafana, our react-data-grid fork has been powering our Table panel for the past 9 months or so. One of the features we really need in our table panel is a mode where dynamic content can be supplied by a datasource (see the Grafana docs).

We forked from the package when the decision was made in this project to drop support for React 18 on a non-breaking version update, but now that Grafana 13 is released and we are getting closer to having React 19 as the only supported version for Grafana going forward, we want to get back on the main package. But to do that we need dynamic row height support since we have added that in our fork and we now depend on that being available in some form. We're open to the specific form it takes, though, so please let us know if you have concerns with the approach in here.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread src/hooks/useViewportRows.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants