Angular 6 and Ag-grid

后端 未结 2 1855
梦谈多话
梦谈多话 2021-01-16 13:43

I\'m doing a test with Angular 6 and Ag-Grid. I have done an example and it paints it, I mean the css and so on.

But by doing the example below and enter the real da

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-16 14:11

    Try as below:

    @Component({
      selector: "my-app",
      template: `
    ` }) export class AppComponent { private gridApi; private gridColumnApi; private rowData: any[]; private columnDefs; private defaultColDef; private defaultColGroupDef; private columnTypes; constructor(private http: HttpClient) { this.columnDefs = [ { headerName: 'ID', field: 'id', width: 100 }, { headerName: 'Nombre', field: 'name', width: 200 } ]; } onGridReady(params) { this.gridApi = params.api; this.gridColumnApi = params.columnApi; this.http .get( "https://raw.githubusercontent.com/ag-grid/ag-grid/master/packages/ag-grid-docs/src/olympicWinnersSmall.json" ) .subscribe(data => { this.rowData = data; }); }

提交回复
热议问题