I'm trying to add a delete button for a list of elements in a ag-grid table.
I created a component for the button and I'm able to remove the row with
...
export class AgGridButtonDeleteComponent implements ICellRendererAngularComp
...
deleteFunc(){
this.params.api.selectIndex(this.params.node.rowIndex);
var selectedData = this.params.api.getSelectedRows();
this.params.api.updateRowData({remove: selectedData});
...
but i also need to call a service to actually remove the data so i tried to include the service in the button component
this.myService.deleteRow(this.value).subscribe(
response => {
if(response){
this.params.api.selectIndex(this.params.node.rowIndex);
var selectedData = this.params.api.getSelectedRows();
this.params.api.updateRowData({remove: selectedData});
}
}
);
but i get this error: Property 'deleteButtonRenderer' is incompatible with index signature. Type 'typeof AgGridButtonDeleteComponent' is not comparable to type 'new () => any'.
any suggestions on how can i do that? I'm using ag-grid 16.0.0 and angular 6, all examples i've found are for angular 1
thank you