6
votes

For a given column definition, when using aggFunc the headerName appears in format func(string) - I just want the header to display the string I define. This behaviour does not exist when AggFunc is null.

const  columnDef: any = {

    headerName: 'Test',
    field: date,
    suppressMenu: true,
    width: 80,
    editable: true,
    lockPosition: true,
    type: 'numericColumn',
    aggFunc: function(data) {

      let sum = 0;
      data.forEach( function(value) {
        if (value) {
            sum = sum + parseFloat(value);
          }
      } );
      if (!sum) { return null; }

      return sum.toFixed(2);
    },
}

The headerName should say "test", but will instead show func(test).

https://imgur.com/a/mJoM5tw

1
can you create a working example on StackBlitz?GreyBeardedGeek

1 Answers

17
votes

You need to mark this property as true in your gridOptions.

suppressAggFuncInHeader : true;

As per docs-

When true, column headers won't include the aggFunc, eg 'sum(Bank Balance)' will just be 'Bank Balance'.