ag-grid

Ag-grid Angular firstDataRendered does not fire

允我心安 提交于 2020-12-15 06:45:56
问题 I am using ag-grid for my data table. When testing the event firstDataRendered, it does not fire at all while gridReady does fire. I just have a basic function fire() { console.log("HEY") } assigned to it. Is there anything that blocks this event from fire? <ag-grid-angular style="width: auto; height: 250px" [rowData]="tblData" [columnDefs]="tableHeaders" [gridOptions]="gridOptions" [defaultColDef]="defaultColDef" (firstDataRendered)="fire($event)" (gridReady)="onGridReady($event)"> </ag-grid

Ag-grid Angular firstDataRendered does not fire

非 Y 不嫁゛ 提交于 2020-12-15 06:45:03
问题 I am using ag-grid for my data table. When testing the event firstDataRendered, it does not fire at all while gridReady does fire. I just have a basic function fire() { console.log("HEY") } assigned to it. Is there anything that blocks this event from fire? <ag-grid-angular style="width: auto; height: 250px" [rowData]="tblData" [columnDefs]="tableHeaders" [gridOptions]="gridOptions" [defaultColDef]="defaultColDef" (firstDataRendered)="fire($event)" (gridReady)="onGridReady($event)"> </ag-grid

ag-grid set cellRendererParams to values from the row data

白昼怎懂夜的黑 提交于 2020-12-15 05:45:52
问题 I want to send data to my cellRenderer component via the cellRendererParams object but I don't know how to access row data for this. Here's an example of what I want to do: cellRendererParams: { label: currentRowData.myField + currentRowData.myOtherField } I don't want my cellRenderer component to have knowledge of the data structure of the grid since I may use it in other grids with different row data. 回答1: there are many ways: 1) valueGetter: (params) => ({ property1: params.data.myField1 +

ag-grid set cellRendererParams to values from the row data

£可爱£侵袭症+ 提交于 2020-12-15 05:45:06
问题 I want to send data to my cellRenderer component via the cellRendererParams object but I don't know how to access row data for this. Here's an example of what I want to do: cellRendererParams: { label: currentRowData.myField + currentRowData.myOtherField } I don't want my cellRenderer component to have knowledge of the data structure of the grid since I may use it in other grids with different row data. 回答1: there are many ways: 1) valueGetter: (params) => ({ property1: params.data.myField1 +

Unit testing ag-grid in Angular 2

我们两清 提交于 2020-12-02 06:53:26
问题 Has someone worked on unit testing ag-grid components in Angular 2? For me, this.gridOptions.api remains undefined when the test cases run. 回答1: Sorry to be a little late to the party but I was looking for an answer to this just a couple of days ago so wanted to leave an answer for anyone else that ends up here. As mentioned by Minh above, the modern equivalent of $digest does need to be run in order for ag-grid api's to be available. This is because after the onGridReady() has run you have