Ag-grid: How to change define column headerName when using AggFunc?

Discussão em 'Angular' iniciado por Troyd, Outubro 22, 2024.

  1. Troyd

    Troyd Guest

    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://i.sstatic.net/xHPMh.jpg

    Continue reading...

Compartilhe esta Página