I'm having a simple angular component that implements an ag-grid like that:
<ag-grid-angular
*ngIf="data"
domLayout='autoHeight'
class="ag-theme-material"
suppressFieldDotNotation="true"
[pagination]="true"
[paginationPageSize]="5"
[defaultColDef]="defaultColDef"
[gridOptions]="gridOptions"
[frameworkComponents]="frameworkComponents"
[rowData]="data.rowData"
[columnDefs]="data.columnDefs"
(gridReady)="onGridReady($event)"
(cellKeyPress)="onCellKeyPress($event)">
</ag-grid-angular>
Then I'm using this component inside other components where I need to display grid-able data.
<shared-grid [data]="projectStore.datasetsGridData | async" (action)="onDatasetsTableAction($event)"></shared-grid>
As you can see I'm using an observable to set grid's columnDefs
and rowData
.
The grid is configured to use a cellRenderer
component that implements a clickable element in one of the columns like:
<div (click)="doSomething()">...</div>
I noticed that for those grids that the data ([data] input
) continuously change the cell with the custom clickable div loses its clickability as long as the data changes. When new data stop coming up the div is clickable again.
I'm thinking that this is happening due to continuous refreshing of the grid but I'm not 100% sure. If that's the case is there any workaround for this effect to stop happening?