You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to auto-resize a resizable column by double-clicking on the resizer in the header.
This behavior is something users know for example from excel.
There was also a similar issue for Vaadin framework.
Describe the solution you'd like
A double click should basically auto-resize the column to the width it would get when setting auto-width to true and recalculating the column widths.
Describe alternatives you've considered
Currently, I create my own grid-connector which adds this functionality.
First of all I overwrite the method _columnTreeChanged of the grid to know when new columns are added. That way I can register the double click listeners for the new columns.
In the listener, I set autoWidth=true, call recalculateColumnWidths and then I set autoWidth to false again. This works mostly, because I don't really use autoWidth outside this functionality.
Last but not least, I dispatch a column-reisze event, so that also the server gets notified about the new column widths.
This works pretty good but of course a build-in solution would be much cleaner.
Additional context
Flow: 24.3.10
Vaadin: 24.3.11
The text was updated successfully, but these errors were encountered:
Describe your motivation
I would like to be able to auto-resize a resizable column by double-clicking on the resizer in the header.
This behavior is something users know for example from excel.
There was also a similar issue for Vaadin framework.
Describe the solution you'd like
A double click should basically auto-resize the column to the width it would get when setting auto-width to true and recalculating the column widths.
Describe alternatives you've considered
Currently, I create my own grid-connector which adds this functionality.
First of all I overwrite the method
_columnTreeChanged
of the grid to know when new columns are added. That way I can register the double click listeners for the new columns.In the listener, I set
autoWidth=true
, callrecalculateColumnWidths
and then I setautoWidth
to false again. This works mostly, because I don't really useautoWidth
outside this functionality.Last but not least, I dispatch a
column-reisze
event, so that also the server gets notified about the new column widths.This works pretty good but of course a build-in solution would be much cleaner.
Additional context
Flow: 24.3.10
Vaadin: 24.3.11
The text was updated successfully, but these errors were encountered: