I demonstrated my real world big project with this tiny stackblitz example.I have ag-grid and all columns are clickable via (cellClicked)="onCellClicked($event)"
<div style="width: 400px;">
<ag-grid-angular #agGrid style="width: 100%; height: 200px;" class="ag-theme-fresh"
(cellClicked)="onCellClicked($event)" [gridOptions]="gridOptions" [suppressRowClickSelection]="true">
</ag-grid-angular>
</div>
onCellClicked(params) {
alert("Cell clicked");
}
I also inserted buttons on last column with buttonRenderer like below
{
headerName: "Assign buttons",
width: 100,
cellRenderer: this.buttonRenderer
}
buttonRenderer(params) {
return "<button (click)='assign()'>Assign me</button>";
}
assign() {
alert("Assigned");
}
After all these configuration grid looks like below
Here problem is when buttons on Assign column clicked, method assign() never triggered. Always onCellClicked() triggered and prints "Cell clicked". I went through ag-grid docs and found suppressRowClickSelection but didn't work for me. Also gave stopPropagation to button but didn't work either. How can I trigger clicked button's method assign() when clicked?
