In my case : i want to reload the ag grid with user selected (when user navigate back using previous button ).
Below code will reselect the checkbox again, based on userContext
name value.
Code:
const gridReady = (params) => {
params.api.forEachNode((node) => {
if(node.data.name === userContext.name) {
node.setSelected(true);
}
});
}
<AgGridReact onGridReady = {gridReady}/>