3
votes

Is there a way to adjust the header height of the headers in ag-Grid? I would like to increase the height if the title is longer than the column width. I know that I can set the height in the gridOptions, but I want the height to be changed 'on the fly'.

I got this css styling to break the words, it works fine for me,

.ag-header-cell-label {
text-overflow: clip;
overflow: visible;
white-space: normal;
}

but I didn't find a way to change the height.

2

2 Answers

0
votes

There is a headerHeight method setHeaderHeight(heightInPx)

This sets the height in pixels for the row containing the column label header. There are setter methods that can be called from the API and will change the header heights dynamically. Have you tried this?

you can check more details on ag-grid website, they have examples as well. Hope it will help.

0
votes

There are only two types of header height settings for AG grid version 24.

  1. groupHeaderHeight – sets height of grouped headers.
  2. headerHeight – sets height of leaf headers.

If a grid has 3 level headers, level 1 and 2 can be set using ‘groupHeaderHeight’ and level 3 using ‘headerHeight’. There is no option to set height of headers at level 1 or 2 independently.