I have an ag grid in my application
I am not able to get any filtered values applied on these columns. How do we apply valueFormatter and filter params in this scenario?
In the below column, I am getting 0,1 as input and rendering them to strings using the cellrenderer option in ag-grid. as shown here in ag-grid
I have the below in my search input box
//search box
<mat-input-container>
<input matInput placeholder="Quick Search" style="width: 250px"
(keyup)="onQuickFilterChanged($event)">
</mat-input-container>
// column definition in ag-grid
{
headerName: 'Header',
field: 'isheader',
width: 100,
filter: 'string',
cellRenderer: function (params: any) {
if (params.value === 1) {
return 'Yes';
} if (params.value === 0) {
return 'No';
}
return params.value;
},
colId:'isPdm',
},
Filter can be applied by adding another definition getQuickFilterText on the column as explained here
getQuickFilterText: function (params: any) {
if (params.value === 1) {
return 'Yes';
} if (params.value === 0) {
return 'No';
}
return params.value;
},
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments