BTMorton / angular2-grid

A drag/drop/resize grid-based plugin directive for angular2
https://bmorton.co.uk/angular/
MIT License
354 stars 159 forks source link

resize of the grid #222

Closed capcar closed 7 years ago

capcar commented 7 years ago

Hi, I insert your application in my project. I have this situation:

|__ 1 __| |_ 2 _| |__ 3 __| 
|_ 4 _| |__ 5 __| |_ 6 _|

I'd like that there isn't white space. For example I want it:

|__ 1 __| |_ 2 _| |__ 3 __| 
|_ 4 _| |__ 5 __| |__ 6 __| 

and when I resize the window, I'd like the size of each Itemgrid to be adaptable to size of window, so I do not have the scroll bar. How can I do this?

Thanks

OnlyAGhost commented 7 years ago

Generally the best way would be to put a window:resize event on a div around the grid and use that to adjust the property of the grid items. So for instance:

<div id="content-container" (window:resize)="onResize($event)"> </div>

Then use the onResize function to update the grid items accordingly.

Thanks! Brian

capcar commented 7 years ago

ok thanks!