Currently working on a custom filter for AG-Grid, and it's mostly working, save for when new rows are loaded in. I want to be able to see which rows are loaded, in order to update the data inside of the custom filter. I've tried to use the IFilterParams.rowModel.forEachNode(), but to no avail. Here's the jist of what I'm seeing:
export class MyCustomFilter implements IFilterAngularComp {
// (...)
agInit(params: IFilterParams): void {
this.params = params;
}
onNewRowsLoaded() {
console.log("new_rows_loaded_start");
this.params.rowModel.forEachNode((n) => {
console.log("test");
});
console.log("new_rows_loaded_end");
}
// (...)
}
Here's what I'm seeing in my console output, after some new rows are loaded:
new_rows_loaded_start
new_rows_loaded_end
Notice how there aren't any "test" entries there. If I do a params.rowModel.forEachNode() anywhere else (outside of the onNewRowsLoaded() method), it prints out the appropriate number of "test" entries. I've been relying on the forEachNode() to get the state of the grid inside my filter, so my issues are the following:
- Is it expected that the rowModel.forEachNode() wouldn't work properly inside of the onNewRowsLoaded() method?
- If I can't rely on the rowModel.forEachNode() here to determine the newly added rows, would there be another way of doing this?