agGroupCellRenderer not found

krishna sinha picture krishna sinha · Feb 1, 2018 · Viewed 7.5k times · Source

I upgraded the ag-grid & ag-grid-react to 14.2.0, but I still get this warning:

ag-grid: Looking for component [agGroupCellRenderer] but it wasn't found.

My column definitions:

let columnDefs = [
    {headerName: 'Name', field: 'userName', width:163, cellRenderer:'agGroupCellRenderer'},
    {headerName: 'Job Title', field: 'jobTitle', width:143},
]

What am I missing here?

Answer

Mr. Green picture Mr. Green · Jan 20, 2020

To those who have this message "ag-Grid: Looking for component" with Angular 8, check to see if you have it referenced on your HTML page. In my code, I was missing some reference code in the HTML file. Here is a rough example that could help someone:

EXAMPLE

Component File:

import { AgGroupCellRendererComponent } from 
'../../global/components/agGroupCellRenderer.component';

columnDefs= [{headerName: 'Name', field: 'userName', width:163, 
cellRenderer:'agGroupCellRenderer'}]

frameworkComponents: any;
constructor() {
    this.frameworkComponents = {
      agGroupCellRenderer: AgGroupCellRendererComponent,
    };
}

HTML File:

<ag-grid-angular
  style="width: 100%; height: 500px;"
  class="ag-theme-balham"
  [gridOptions]="gridOptions"
  [rowData]="rowData"
  [frameworkComponents]="frameworkComponents"
>