From 6321c48d1b3a6469ffcdd0a9b9b50668edcb6892 Mon Sep 17 00:00:00 2001 From: Ronan Tavares Camargo Date: Wed, 21 Jun 2017 17:04:26 -0300 Subject: [PATCH 1/2] Fix #4949 - pinnedRight adding an extra blank column --- src/js/core/factories/GridRenderContainer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/js/core/factories/GridRenderContainer.js b/src/js/core/factories/GridRenderContainer.js index 5652468372..5233c6e761 100644 --- a/src/js/core/factories/GridRenderContainer.js +++ b/src/js/core/factories/GridRenderContainer.js @@ -608,7 +608,8 @@ angular.module('ui.grid') var asterisksArray = [], asteriskNum = 0, usedWidthSum = 0, - ret = ''; + ret = '', + pinRightColumn = false; // Get the width of the viewport var availableWidth = self.grid.getViewportWidth() - self.grid.scrollbarWidth; @@ -626,6 +627,14 @@ angular.module('ui.grid') // Skip hidden columns if (!column.visible) { return; } + if(pinRightColumn) { + availableWidth += self.grid.scrollbarWidth; + } + + if (!pinRightColumn && column.colDef.pinnedRight) { + pinRightColumn = true; + } + if (angular.isNumber(column.width)) { // pixel width, set to this value width = parseInt(column.width, 10); From a4ec5d0934141e3316fd0464636261cf5def320c Mon Sep 17 00:00:00 2001 From: Ronan Tavares Camargo Date: Wed, 21 Jun 2017 17:27:42 -0300 Subject: [PATCH 2/2] Fix #4949 - pinnedRight adding an extra blank column --- src/js/core/factories/GridRenderContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/core/factories/GridRenderContainer.js b/src/js/core/factories/GridRenderContainer.js index 5233c6e761..cb471ee26c 100644 --- a/src/js/core/factories/GridRenderContainer.js +++ b/src/js/core/factories/GridRenderContainer.js @@ -627,7 +627,7 @@ angular.module('ui.grid') // Skip hidden columns if (!column.visible) { return; } - if(pinRightColumn) { + if (pinRightColumn) { availableWidth += self.grid.scrollbarWidth; }