How to get the name of column header by clicking the header of a column in ag-grid, actually I want to perform server-side sorting and filtering when clicking on a column header, for that, I need the name of the column on an event.
HTML Template
<ag-grid-angular [gridOptions]="gridOptions" style="width: 100%;
height: 650px;" (gridReady)="onGridReady($event)"
class="ag-theme-balham" [columnDefs]="columnDefs"
[rowData]="rowData">
</ag-grid-angular>
TS
rowData;
columnDefs = [
{
headerName: "name",
field: "athlete",
},
{
headerName: "Status",
field: "age"
}
];
onGridReady(params: any) {
this.service.getData().subscribe((e)=>{
this.rowData = e;
});
}