Grid - recalculateColumnWidths on Scrolling Event OR based on the whole container
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by quambel
I set the size of my Grid to setSizeFull and adds more data than could display at once. The grid adds a scrollbar by itself. When I scroll through the items the width of the column doesn't resize. If the line is wider than the previous one the content isn't completely displayed. When I scroll down and execute the recalculateColumnWidths() method the column width resize to the items but only to the items that are visible.
Can you please execute the recalculateColumnWidths method while scrolling?
Or can you please add a scrolling listener to the grid? Then I could integrate it by myself.
Or can you please calculate the coulmn with of each column on the biggest cell of the whole container, not only on the visible items?
My workaround:
recalculateColumnWidths every 2 seconds, works but this is the worst solution
Imported from https://dev.vaadin.com/ issue #17438
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Grid.recalculateColumnWidths() entry point and trace how column widths are measured for visible items during scrolling. Reproduce the issue with a full-size Grid containing more rows than fit on screen, then determine the expected behavior for newly visible wider content or whole-container measurement. Done means column content remains fully visible without periodic polling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100