Adding ID to ag-grid row

Asked by At

I would like to identify the divs representing the rows of my ag-grid.

What I've tried:

onGridReady(params) {
  this.gridApi = params.api;
  this.gridApi.forEachNode(rowNode => {
    rowNode.setId('opo-item-index-'+rowNode.data.lineIndex);
    rowNode.id = 'opo-item-index-'+rowNode.data.lineIndex;
  });
}

Neither of those has worked. Is there any other way to achieve this? The identifier doesn't have to be in id attribute, it could as well be in data-*

Thanks :)

1 Answers

0
A Ghanima On Best Solutions

You just need to redraw the rows after setting the id

this.gridApi.redrawRows({rowNode})