Skip to content

Commit

Permalink
Merge pull request #4704 from oriondean/4687-grid-column-leak
Browse files Browse the repository at this point in the history
4687 grid column leak
  • Loading branch information
swalters committed Nov 16, 2015
2 parents a8b909d + 544b811 commit ed980e6
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/js/core/factories/GridColumn.js
Expand Up @@ -97,16 +97,6 @@ angular.module('ui.grid')

self.updateColumnDef(colDef, true);

/**
* @ngdoc function
* @name hideColumn
* @methodOf ui.grid.class:GridColumn
* @description Hides the column by setting colDef.visible = false
*/
GridColumn.prototype.hideColumn = function() {
this.colDef.visible = false;
};

self.aggregationValue = undefined;

// The footer cell registers to listen for the rowsRendered event, and calls this. Needed to be
Expand Down Expand Up @@ -195,6 +185,16 @@ angular.module('ui.grid')
};
}

/**
* @ngdoc function
* @name hideColumn
* @methodOf ui.grid.class:GridColumn
* @description Hides the column by setting colDef.visible = false
*/
GridColumn.prototype.hideColumn = function() {
this.colDef.visible = false;
};


/**
* @ngdoc method
Expand Down Expand Up @@ -806,15 +806,17 @@ angular.module('ui.grid')
}
});
}
};

// Remove this column from the grid sorting, include inside build columns so has
// access to self - all seems a bit dodgy but doesn't work otherwise so have left
// as is
GridColumn.prototype.unsort = function () {
this.sort = {};
self.grid.api.core.raise.sortChanged( self.grid, self.grid.getColumnSorting() );
};

/**
* @ngdoc function
* @name unsort
* @methodOf ui.grid.class:GridColumn
* @description Removes column from the grid sorting
*/
GridColumn.prototype.unsort = function () {
this.sort = {};
this.grid.api.core.raise.sortChanged( this.grid, this.grid.getColumnSorting() );
};


Expand Down

0 comments on commit ed980e6

Please sign in to comment.