ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Footer canvas width problem

Open iorzetic opened this issue 11 years ago • 1 comments

I noticed a small problem with the width calculation for the class .ui-grid-footer-canvas:

ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-footer-canvas { width: ' + canvasWidth + grid.scrollbarWidth + 'px; }';

This is clearly just a minor slip but since I found it I thought that I should report it. The problem is obvious here: we are trying to add together strings and integers. In Javascript this is processed as concatenation of strings (and the outcome here is a very very large width). The correct code for this should include some parenthesis for the integer addition, like so:

ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-footer-canvas { width: ' + (canvasWidth + grid.scrollbarWidth) + 'px; }';

A similar line but with the correct parenthesis exists a few lines before, for the calculation of the .ui-grid-header-canvas width.

I should have probably created a pull-request for this but I am not familiar at all with the procedure. I will try to do that in the future, after I read all the documentation.

iorzetic avatar Apr 02 '15 13:04 iorzetic

Good find!

You can start with https://github.com/angular-ui/ng-grid/blob/master/CONTRIBUTING.md as a primer.

c0bra avatar Apr 06 '15 22:04 c0bra