How to apply filter to a cell renderer in ag grid

prabhat gundepalli

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',
     },
prabhat gundepalli

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.

edited at
0

Comments

0 comments
Login to comment

Related

WxGo Grid Cell renderer

AG-Grid - How to insert a line break into my cell data

Angular ag-grid cell renderer checkbox not refresh value

Ag-Grid : How to get the focused cell value

ag-grid renders on top of cell renderer

How to conditionally enable/disable cell renderer in Ag-Grid?

How to set cell dividers on the ag grid

Ag Grid cell renderer not instantiated until scrolled back in view

How to Render an Angular routerLink inside the cell of an ag-Grid?

How to Customize Number Input Type Cell ag-grid

How to apply custom css class in ag-grid cell in angular?

ag-grid cell renderer that shows data from multiple columns

Ag-grid cell renderer with slider not working

How to display enum value in ag-grid cell field value?

ag-grid cell editors - how to save data to backend

how to delete ag-grid row with a button in cell renderer

ag-grid vue.js: How to access to the parent grid method of a renderer in typescript?

Dynamically changing Cell Renderer of ag-grid using param function in Angular 8

Angular ag-grid : How to render HTML in cell?

How to get Ag Grid to display blank cell via cellRendererSelector

How to make cell content in ag-grid centered vertically?

ag-grid checkbox column checked by renderer

ag-Grid/Reactjs - How to get cell value in columnDefs

Angular ag-Grid: custom cell renderer that turns on edit mode over all editable cells in row

How to apply ag-grid custom filter when clicking a button

how to add border to a hovered cell in ag-grid angular?

How to align the checkbox and text in cell to center in ag grid angular

how to get filter input value in Ag grid filter with react?

Ag-Grid : How to get the value of the cell on clicking the cell