'Property 'dateComponentFramework' does not exist on type 'GridOptions
I am trying to use some code in Angular 13 when using AG Grid Version 27.2.1 and i am trying to assign some Date Option to my grid.In AG Gris 25.01 this was stll an option under GridOptions. What hs this been replaced by and how do i get this to work in 27.x again ?
import {Component, Input, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
import {GridOptions} from 'ag-grid-community';
import {DateComponent} from '../date-component/date.component';
import {HeaderComponent} from '../header-component/header.component';
import {ApiService} from '../../../../services/api/api.service';
import {takeWhile} from 'rxjs/operators';
@Component({
selector: 'app-rich-grid',
templateUrl: 'rich-grid.component.html',
styleUrls: ['rich-grid.css'],
encapsulation: ViewEncapsulation.None
})
export class RichGridComponent implements OnInit, OnDestroy {
private gridOptions: GridOptions;
public showGrid: boolean;
public rowData: any[];
public rowCount: string;
@Input() title: string;
@Input() columnDefs: any[];
@Input() rowSelection = 'multiple';
@Input() rowModelType = 'infinite';
@Input() paginationPageSize = 100;
@Input() cacheOverflowSize = 2;
@Input() maxConcurrentDatasourceRequests = 2;
@Input() infiniteInitialRowCount = 1;
@Input() maxBlocksInCache = 2;
@Input() getRowNodeId: Function;
@Input() dataUrl: string;
private alive = true;
constructor(private api: ApiService) {
// we pass an empty gridOptions in, so we can grab the api out
this.gridOptions = <GridOptions>{};
this.showGrid = true;
this.gridOptions.dateComponentFramework = DateComponent;
this.gridOptions.defaultColDef = {
resizable: true,
sortable: true,
filter: true,
headerComponentFramework: <new() => HeaderComponent>HeaderComponent,
headerComponentParams: {
menuIcon: 'fa-bars'
}
};
}
ngOnInit(): void {
//
}
Solution 1:[1]
I think it should be registered in components grid property
components: {
agDateInput: DateComponent,
}
Check this link: Ag-grid Date component
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |