Search code examples
javascriptangularag-gridag-grid-angular

Resize column headers in Angular ag-grid on sort


When I click on my header row to sort a column, it adds an up/down arrow to the header, to the right of my header text. This is making the header text truncate.

Is there a way to have the header width autosize to accommodate the up/down arrow added when sorting?

Before clicking header to sort, the header text is "Date Updated" After clicking header to sort, the header text becomes truncated to just "Date"


Solution

  • Give a fixed width to column so it can accommodate both text and arrow icon -

    { headerName: 'Col C', field: 'c', width: 100, editable: false, filter: 'agTextColumnFilter' }