angular-ui/ui-grid

Column width by percentage does not account for selection column

Open

#6,093 创建于 2017年3月17日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (5,395 star) (2,496 fork)batch import
good first issue

描述

Expected Behavior When defining columns with percentage widths, if the columns defined in gridOptions.columnDefs add up to a total of 100%, they will fill up and not overflow the grid viewport.

Actual Behavior If ui-grid-selection is being used, the columns will overflow the grid viewport by the width of the selection column.

The selection column is a part of the grid control itself and not the data display, as evidenced by not being defined in columnDefs, so its size should be accounted for when calculating the size of the viewport, much like the vertical scroll bar is.

This plunker illustrates the issue by defining one 100% width column in a selectable grid: http://plnkr.co/edit/BcV3qI64mMOnNMdDAjPM?p=preview

You will have to enter app.js and change enableRowHeaderSelection to false to see that the sizing is correct when the selection row header is removed, as indicated by the comment there. (I tried to wire up a button to do this, but couldn't get the grid to recognize the change.)

贡献者指南