From c556fafe50b7417f47986add9f14b79a9eb61ef0 Mon Sep 17 00:00:00 2001 From: freein Date: Mon, 3 Nov 2014 17:11:50 +0100 Subject: [PATCH] Performance improvement --- src/js/core/directives/ui-grid-native-scrollbar.js | 3 ++- src/js/core/factories/GridOptions.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/core/directives/ui-grid-native-scrollbar.js b/src/js/core/directives/ui-grid-native-scrollbar.js index a34c07e4f6..c314accc42 100644 --- a/src/js/core/directives/ui-grid-native-scrollbar.js +++ b/src/js/core/directives/ui-grid-native-scrollbar.js @@ -80,7 +80,8 @@ // Update the vertical scrollbar's content height so it's the same as the canvas var contentHeight = rowContainer.getCanvasHeight(); - var headerHeight = gridUtil.outerElementHeight(containerCtrl.header); + //var headerHeight = gridUtil.outerElementHeight(containerCtrl.header); + var headerHeight = colContainer.headerHeight ? colContainer.headerHeight : grid.headerHeight; // gridUtil.logDebug('headerHeight in scrollbar', headerHeight); diff --git a/src/js/core/factories/GridOptions.js b/src/js/core/factories/GridOptions.js index a978dcfe8f..11cda66830 100644 --- a/src/js/core/factories/GridOptions.js +++ b/src/js/core/factories/GridOptions.js @@ -128,8 +128,11 @@ angular.module('ui.grid') baseOptions.getRowIdentity = baseOptions.getRowIdentity || function getRowIdentity(row) { return row.$$hashKey; }; - - baseOptions.headerRowHeight = typeof(baseOptions.headerRowHeight) !== "undefined" ? baseOptions.headerRowHeight : 30; + if (baseOptions.hideHeader){ + baseOptions.headerRowHeight = 0; + }else { + baseOptions.headerRowHeight = typeof(baseOptions.headerRowHeight) !== "undefined" ? baseOptions.headerRowHeight : 30; + } baseOptions.rowHeight = baseOptions.rowHeight || 30; baseOptions.maxVisibleRowCount = baseOptions.maxVisibleRowCount || 200;