Better datagrid2 Column Header Width Styling - Mendix Forum

Better datagrid2 Column Header Width Styling

0

If you set a column to fit-content, the table applies static widths to the table header, but only based on the content of the column cells and not taking into account the column headers.

image.png

This results in the headers being cut off, which is not a behavior that you ever want, because a column header that give you no way of seeing what the header text says is a worthless header:

image.png

Instead, the script that applies the static grid template widths should check to make sure the width set does not cut off the column header, using the header width instead of the cell width is lower. In other words, if the header width is wider than the cell width, use the header width instead.

 

The only workaround currently is to set the cell to custom content, then set a static width on the wrapper container to force the applied width to match the expected header width. Of course this is not ideal since if you change the header text, you have to manually adjust the custom content width.

asked
0 answers