0
votes

I have a merged header in ag-grid. Im trying to update the parent header name 'Details'. The following is the simplified column definition.

I am able to get and update the headerName of the children header by using

$scope.ag_gridOptions_data.columnApi.getColumn("Items") 

However my parent header do not have a field so I cannot use the above code. I tried to give it a dummy field but it returns null.

var my_colDef= [
    {
        headerName: 'Details',
        children:[
            {
                headerName: 'Id',
                field: 'Items'
            }
        ]
]
1

1 Answers

1
votes

The column name can be dynamic. You just need to configure colDef.headerValueGetter to return the new header name and then call api.refreshHeader() to refresh the header.

Plunker