Angular-gridster2: Container height not set

Created on 9 Jan 2019  路  8Comments  路  Source: tiberiuzuld/angular-gridster2

Is it possible not to set container height? I want to define item height only (row height).

Now I think I always have to define container height.

question

Most helpful comment

Hi @piernik ,
I think @petarGitNik is right.
Thanks @petarGitNik

All 8 comments

@piernik Which container? I think that grid container has to have height defined with css (but I'm not a associated with this project, so I don't have the best knowledge about it). If you want do define height of the cell (row) then you have to use _vertical fixed_ grid type i.e. gridType: GridType.VerticalFixed together with the row height option. E.g.

this.options = {
    gridType: GridType.VerticalFixed,
    fixedRowHeight: 500
}

Container of whole grid:

<div class="container" style="height: 500px">
<gridster [options]="options"></gridster>
</div>

I have to set height of div.container and I don't want to. Toy solution is not working for me.

Edit:
it started to work when I added in css

gridster.scrollVertical {
  overflow: visible !important;
}

but it's not perfect - gridster is not propper block tag (it has no height)

@piernik As far as I know, the container of the gridster needs to have the height set - the gridster will then take all the possible space of the parent element. This is because the gridster is a block element with height and width defined relative to the parent (using percents in CSS) (as you can see in the source code). So I think that you must set the height of the container div. Maybe you can refactor your HTML markup to match your needs?

Hi @piernik ,
I think @petarGitNik is right.
Thanks @petarGitNik

@tiberiuzuld I want to return to that issue. I still think that there should be option in which gridster will take as much height as needed.

On my site I have gridster with widgets. Due to fixed height of container I often have two sliders, or unecessary one slider.
I post two screenshots:

gridster-1
gridster-2

Is there something You can change?

I noticed that You set gridster-column height. Can You also set gridster height. Off course if propper setting ex. 'adoptGridsterHeight' is set to true

Try setGridSize: true

The setGridSize: true seems to lock both the width and the height on the grid. This prevents the grid from resizing to different form factors it seems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marco-martins picture marco-martins  路  4Comments

CollinGraf314 picture CollinGraf314  路  3Comments

leandro-ali-elel picture leandro-ali-elel  路  4Comments

tiberiuzuld picture tiberiuzuld  路  3Comments

Vojislav-Vukovic picture Vojislav-Vukovic  路  4Comments