Recalculate column widths

This issue has been tracked since 2023-01-22.

Use case

Columns set with max-content only calculate their width on the initial render. It would be nice to have the possibility to trigger a recalculation of the column sizes when needed, and have all columns' width update accordingly.

Proposed solution

Because it's a expensive operation, I think it's probably better to have it as part of the imperative ref.

If I'm not missing anything, the implementation should be straightforward: just update setColumnWidths with a map that excludes the columns with max-content (and similar). I did a patched version of react-data-grid that adds recalculateColumns: () => setColumnWidths(() => new Map()) on the useImperativeHandle and it works in a way that would fit my needs.

More Details About Repo
Owner Name adazzle
Repo Name react-data-grid
Full Name adazzle/react-data-grid
Language TypeScript
Created Date 2015-03-06
Updated Date 2023-03-23
Star Count 5922
Watcher Count 129
Fork Count 2072
Issue Count 161

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date