Skip to content

Commit 544b811

Browse files
committed
(fix): Fix #4687 - Memory leaks - grid object not getting destroyed
Prevent the grid column's unsort method being overriden each time a GridColumn is constructed
1 parent 84e2434 commit 544b811

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/js/core/factories/GridColumn.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -806,15 +806,17 @@ angular.module('ui.grid')
806806
}
807807
});
808808
}
809+
};
809810

810-
// Remove this column from the grid sorting, include inside build columns so has
811-
// access to self - all seems a bit dodgy but doesn't work otherwise so have left
812-
// as is
813-
GridColumn.prototype.unsort = function () {
814-
this.sort = {};
815-
self.grid.api.core.raise.sortChanged( self.grid, self.grid.getColumnSorting() );
816-
};
817-
811+
/**
812+
* @ngdoc function
813+
* @name unsort
814+
* @methodOf ui.grid.class:GridColumn
815+
* @description Removes column from the grid sorting
816+
*/
817+
GridColumn.prototype.unsort = function () {
818+
this.sort = {};
819+
this.grid.api.core.raise.sortChanged( this.grid, this.grid.getColumnSorting() );
818820
};
819821

820822

0 commit comments

Comments
 (0)