I am using Angular 9 and I have installed all necessary ag-grid packages.
Package.json:
"ag-grid-angular": "^23.1.1",
"ag-grid-community": "^23.1.1",
"ag-grid-enterprise": "^24.0.0"
For ag-grid-enterprise i have added license and which i have imported into main.ts
main.ts
// other imports...
import {LicenseManager} from "ag-grid-enterprise";
LicenseManager.setLicenseKey("license key");
// bootstrap your angular application. ie: platformBrowser().bootstrapModuleFactory(..)
And imported ag-grid-enterprise in the app module and imported styles into style.scss too
import 'ag-grid-enterprise';
import 'ag-grid-community/dist/styles/ag-grid.css';
import 'ag-grid-community/dist/styles/ag-theme-alpine.css';
I have tried to display RowGrouping table and simple table also. Please find some sample code below Html:
<ag-grid-angular
style="width: 500px; height: 150px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs">
</ag-grid-angular>
ts:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.scss' ]
})
export class AppComponent {
columnDefs = [
{field: 'make' },
{field: 'model' },
{field: 'price'}
];
rowData = [
{ make: 'Toyota', model: 'Celica', price: 35000 },
{ make: 'Ford', model: 'Mondeo', price: 32000 },
{ make: 'Porsche', model: 'Boxter', price: 72000 }
];
}
I'm getting below error and table not loading when launch the application into browser. Also Find the screenshot for reference.
TypeError: details.rootNode.updateHasChildren is not function