ag-grid: [angular1] Angular 1.X Scope Based Child Grid not getting destroyed (Memory Leak)
I have implemented the scope based master details grid to achieve the angularCompileRows: true in the child grid, this.MD will be unique ID
DetailPanelCellRenderer.prototype.destroy = function () {
console.log($scope["detailGridOptions" + this.MD])
if ($scope["detailGridOptions" + this.MD].api !== null)
$scope["detailGridOptions" + this.MD].api.destroy();
else
delete $scope["detailGridOptions" + this.MD];
};
So destroy method not happening due to api is null while collapse, But JS based sub grid have api. This Leading the Memory Leak
Grid Objects still in memory because destroy not happen, Please provide solution !
Thanks
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 32 (11 by maintainers)
@ceolter @seanw
I found a fix for this… I’m not gonna make a pull request since it’s really simple. Just do this:
Instead of
Can you please push this in as a fix.
Enjoy 😃
@ceolter @DrorOzgaon Amazing! But…works for me in ag-grid@7.2.2 with Angular 1.6.2 but not in ag-grid@8.0.1. Any guesses why based on finding the previous fix?
Ag-grid 8.0.1 will give this error when you destroy the grid:
The top function in the trace is this:
Version 7 is missing the
if (this.eParentRow)
block. If I just comment out this block in version 8 it seems to fix the leak but the table renders as if the cells have been duplicated and placed on top of each other at an offset.That’s what I’ve tried so far but feel out of my depth understanding how ag-grid does its cleanup and what changed between versions.