Skip to content

Commit d841b92

Browse files
committed
fix(uiGridHeader): Refresh grid with new header
In the case that the header template was arriving in a promise, the grid was not refreshing the canvas and recalculating the header element height. Fixes #2822
1 parent d3af956 commit d841b92

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/js/core/directives/ui-grid-header.js

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
containerCtrl.headerViewport = headerViewport;
5252
}
5353
}
54+
55+
$scope.grid.queueRefresh();
5456
});
5557

5658
function updateHeaderReferences() {

src/js/core/factories/Grid.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1967,11 +1967,11 @@ angular.module('ui.grid')
19671967
container = containerHeadersToRecalc[i];
19681968

19691969
// If this header's height is less than another header's height, then explicitly set it so they're the same and one isn't all offset and weird looking
1970-
if (container.headerHeight < maxHeaderHeight) {
1970+
if (maxHeaderHeight > 0 && typeof(container.headerHeight) !== 'undefined' && container.headerHeight !== null && container.headerHeight < maxHeaderHeight) {
19711971
container.explicitHeaderHeight = maxHeaderHeight;
19721972
}
19731973

1974-
if (container.headerCanvasHeight < maxHeaderCanvasHeight) {
1974+
if (typeof(container.headerCanvasHeight) !== 'undefined' && container.headerCanvasHeight !== null && maxHeaderCanvasHeight > 0 && container.headerCanvasHeight < maxHeaderCanvasHeight) {
19751975
container.explicitHeaderCanvasHeight = maxHeaderCanvasHeight;
19761976
}
19771977
}

0 commit comments

Comments
 (0)