gridstack.js icon indicating copy to clipboard operation
gridstack.js copied to clipboard

Make widgets square regardless the window size

Open vukcuvardic opened this issue 10 years ago • 2 comments

Is it possible to make square widgets regardless the window size? Currently the height of the widgets stay the same on window resizing, while the width changes. This way on narrow screens the widget becomes unproportional. Any help would be more then welcome...

vukcuvardic avatar Dec 17 '15 09:12 vukcuvardic

You could maybe try and override the "mobile" min_width which is default at 768px so once you've hit that break point it'll flip the widgets to fit the screen/phone/ipad view.

DoctaWorm avatar Jan 10 '16 10:01 DoctaWorm

You can set window resize event handler and update grid cells height with value you need: https://github.com/troolee/gridstack.js#cellheightval

Be aware that it could be performance expensive on large grids

troolee avatar Feb 18 '16 03:02 troolee