T
TanStack3y ago
ratty-blush

How to interpret the sizing options

Hi all, I'm looking at how to set sizing of columns. Somehow I feel that the minSize, maxSize and size all basically do the same thing, it just finds the lowest value of all 3 and then ignores all the rest. Reason I'm thinking this is after looking at the source code:
return Math.min(
Math.max(
column.columnDef.minSize ?? defaultColumnSizing.minSize,
columnSize ?? column.columnDef.size ?? defaultColumnSizing.size
),
column.columnDef.maxSize ?? defaultColumnSizing.maxSize
)
},
return Math.min(
Math.max(
column.columnDef.minSize ?? defaultColumnSizing.minSize,
columnSize ?? column.columnDef.size ?? defaultColumnSizing.size
),
column.columnDef.maxSize ?? defaultColumnSizing.maxSize
)
},
I kinda want to have a column have a minimum size, but if there is more screen space only that column can grow to fill in the rest. So I tried setting that column with a minSize of 300, and all the other columns have a fixed size of 100. But it just doesn't seem to be doing what I expect it to do, as all columns just have the width set to the value I set to either minSize or Size.
1 Reply
ratty-blush
ratty-blushOP3y ago
I'd expect there to be a getMinSize() and getMaxSize() helper on the header object or am I missing something?

Did you find this page helpful?