From b54cc344b0a0e0a31e3778aa7c9b1ee8d09ad546 Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Mon, 23 Nov 2015 21:24:03 -0500 Subject: [PATCH] fix(core): Column Menu Hidden by Hiding Column Fixes the column menu being hidden when columns are removed. Closes #3953 --- src/js/core/directives/ui-grid-header-cell.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/core/directives/ui-grid-header-cell.js b/src/js/core/directives/ui-grid-header-cell.js index 9fc547e1ae..4d5c289926 100644 --- a/src/js/core/directives/ui-grid-header-cell.js +++ b/src/js/core/directives/ui-grid-header-cell.js @@ -223,8 +223,10 @@ } contents.addClass(classAdded); - var rightMostContainer = $scope.grid.renderContainers['right'] ? $scope.grid.renderContainers['right'] : $scope.grid.renderContainers['body']; - $scope.isLastCol = ( $scope.col === rightMostContainer.visibleColumnCache[ rightMostContainer.visibleColumnCache.length - 1 ] ); + $timeout(function (){ + var rightMostContainer = $scope.grid.renderContainers['right'] ? $scope.grid.renderContainers['right'] : $scope.grid.renderContainers['body']; + $scope.isLastCol = ( $scope.col === rightMostContainer.visibleColumnCache[ rightMostContainer.visibleColumnCache.length - 1 ] ); + }); // Figure out whether this column is sortable or not if (uiGridCtrl.grid.options.enableSorting && $scope.col.enableSorting) {