Column width by percentage does not account for selection column
#6093 aperta il 17 mar 2017
Metriche repository
- Star
- (5395 star)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
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.)