0

I'm using ag-grid-react and I would like to access all the other column values of a row based on the value of one of its columns. Is this possible? This should be a very easy and direct method but, strangely, I've found no accurate answer in the ag-grid-react documentation.There are multiple methods of api and columnApi but there is no clear link that enables you to get the corresponding row based on the value of one of its columns!

I may be missing something here, I would appreciate your help!

Thank you in advance!

Oumaima
  • 384
  • 2
  • 8

1 Answers1

0

I guess you're looking to filter entire rows based on a certain column value. Firstly you must enable filtering in your grid options use enableFilter: true in your gridOptions.

Next, call a method

gridOptions.api.forEachNodeAfterFilter( function(rowNode, index) {
    console.log('node ' + rowNode.data.athlete + ' passes the filter');
});

This will enable you to iterate through all the nodes after filtering and then you can access any column on the node using rowNode.columnName.