Reputation: 11
I'm using AG grid react enterprise version and using master detail features to show details of a particular master row. I would like to add a feature to dynamically unselect all the detail rows previously selected by user. Is there any way we can do this? I'm programmatically not able to get reference to the detail row nodes.
Upvotes: 1
Views: 601
Reputation: 7614
You need not access the rowNodes of detail grid to clear selections. Having a handle on the detail grid api should do the trick.
From the docs-
You can access the API of all detail grids via the master grid. The API for each detail grid is stored in a DetailGridInfo
Here's what you can do -
// iterate over all DetailGridInfo's, and call clear seletion on each one
masterGridOptions.api.forEachDetailGridInfo(function(detailGridInfo) {
detailGridInfo.api.deselectAll();
});
You should be able to trigger this as per your custom logic and unselect detail rows
Upvotes: 1