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

Grid full height

Open jorsai opened this issue 10 years ago • 8 comments

First of all, congratulations for your plugin, is awesome.

Here is the question. Is it possible keep the grid with full height? It is at the bottom of my page and so difficult to fill or move new elements inside.

(Sorry for my English!)

Thank you!

jorsai avatar Oct 20 '16 23:10 jorsai

You want the grid to be 100% of the screen height? You should be able to do something like this

.someClass {
    height: 100%
}

Then just put your grid inside an element with your someClass class. If you want it to always be on the screen, you can add position: fixed so scrolling the page doesn't affect the position.

csavage1994 avatar Oct 24 '16 18:10 csavage1994

@csavage1994

First of all, this is an awesome plugin. Thanks for creating it!

I am interested also in making the grid full size and added the extra style you mentioned in your post. However as I start rearranging the widgets and make the grid only one widget tall the grid itself resizes and becomes one widget tall.

I am not saying that this behaviour is good or bad, but just curios if I can override this behavior somehow...

gyurisc avatar Oct 27 '16 11:10 gyurisc

Of course @csavage1994 , what a silly question I asked.

jorsai avatar Oct 27 '16 20:10 jorsai

@gyurisc , same problem to me. Do what csavage said, and put your grid styles in the container div, not in the grid.

It will keep resizing, but if you style the container, no one will see the resize.

jorsai avatar Oct 27 '16 20:10 jorsai

you can also try 100vh instead of 100%

clarknelson avatar Oct 28 '16 20:10 clarknelson

@jailbot's solution works as well, mine will style the grid element to 100% of the containing element, using vh will ensure it takes up the full height I believe. Here's a reference to the difference between the two if you're curious! http://stackoverflow.com/questions/27612931/styling-html-and-body-selector-to-height-100-vs-using-100vh

csavage1994 avatar Oct 28 '16 20:10 csavage1994

@jorsai It sounds like you were successful in incorporating @csavage1994 's recommendation. I'm closing this ticket, but if you're still experiencing issue, please feel free to reopen.

radiolips avatar Nov 01 '16 17:11 radiolips

I too am facing the same problem. Because I am using nested grids, the solution of using a container with 100% height doesnt work. Would it be possible to add an option to indicate that the height of the grid should not be updated, so basically making the calls to "GridStack.prototype._updateContainerHeight" optional?

ronvanpol avatar Nov 15 '16 13:11 ronvanpol