试图在我的项目中加入 ag-grid-angular。我已经成功地让它通过过滤和排序处理静态数据。
我现在无法使用异步动态数据进行设置。
<ag-grid-angular
style="width: 1100px; height: 1000px;"
class="ag-theme-balham"
[enableSorting]="true"
[enableFilter]="true"
id ="mygrid"
[animateRows]="true"
[rowData]="rowss | async"
[columnDefs]="columnDefs"
>
</ag-grid-angular>Run Code Online (Sandbox Code Playgroud)
在 component.ts 中:
public rowss: any = null;
this.rowss = this.Service.getReport(this.model)Run Code Online (Sandbox Code Playgroud)
我现在已经静态设置了列
columnDefs = [
{headerName: 'Make', field: 'make' },
{headerName: 'Model', field: 'model' },
{headerName: 'Price', field: 'price'}
];Run Code Online (Sandbox Code Playgroud)
在 Service.ts 中:
getReport( request: ReportModel ) {
return this.http.get( this.URL + super.jsonToQueryParam( request ) ).map(( response: Response ) => response.json() );
}Run Code Online (Sandbox Code Playgroud)
我收到此错误消息:
ng:///ProdCtnReportModule/ProdCtnReportComponent.ngfactory.js:100 ERROR TypeError: rowData.forEach is …Run Code Online (Sandbox Code Playgroud)