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

auto_resize, width and height

Open readme42 opened this issue 9 years ago • 0 comments

I have a simple grid inside a container.

_________________________________
|                                |
|    H E A D E R                 |
|________________________________|
|     |                          |                             
|  M  |                          |         
|  E  |                          |                                                         
|  N  |      G R I D             |
|  U  |                          |                                 
|     |                          |                                 
|     |                          | 
________________________________
visible_cols: 2,
 visible_rows: 1,
col_width: 200,
row_height: 450, 

everything is displayed as expected.

If auto_resize: true is added, the width of each col is calculated correctly respecting the width of the menu. But the height calculation ignores the height of the header - it uses the window height.

A short code inspection shows that

max width is calculated by var maxWidth: number = this._ngEl.nativeElement.getBoundingClientRect().width;

max height is calculated by var maxHeight: number = window.innerHeight - this.marginTop - this.marginBottom;

Is this intended? Why is window.innerHeight used instead of the grid elements height?

readme42 avatar Dec 22 '16 16:12 readme42