Add initWidth argument to colDef#425
Merged
Merged
Conversation
nteetor
commented
May 25, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
- Coverage 95.88% 92.47% -3.42%
==========================================
Files 11 19 +8
Lines 1191 2471 +1280
Branches 0 733 +733
==========================================
+ Hits 1142 2285 +1143
- Misses 49 160 +111
- Partials 0 26 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
glin
approved these changes
Jun 16, 2026
Owner
There was a problem hiding this comment.
Looks good, thanks. I'll follow up with a NEWS Item too, but won't/can't push to your main branch:
colDef()gains aninitWidthargument to set a column's initial width in pixels while keeping the column resizable. Unlikewidth, which sets a fixed width and disables resizing,initWidthonly sets the starting width, so the column can still be resized within itsminWidthandmaxWidth. (@nteetor, #223, #374)
edit: done in 4a43839
This was referenced Jun 16, 2026
Contributor
Author
|
Great news, thank you, @glin! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an
initWidthcolumn to thecolDeffunction. As described in #223 and #374 there isn't currently a way to specify a column's initial width and allow column resizing.I adjusted the javascript column logic to set
widthtoinitWidth, if specified. The behavior of the other width arguments remain unchanged.Changes
initWidthargument tocolDef()colDef()for the following,initWidthis null or numericinitWidthandwidthcannot both be specifiedinitWidthis greater than or equal tominWidthinitWidthis less than or equal tominWidth