Skip to content

Set StaticGrid behaviour 0.3 #743

Closed
Closed
@kool-kat

Description

@kool-kat

Hi,

I have done a trawl through issues past and present and see a few tickets referring to StaticGrid option not behaving as expected.

I have created a 2 piece grid and initialised it as staticGrid=true

I know it is seeing this parameter as it is applying the CSS class grid-stack-static to the wrapper grid DIV.

BUT each piece in the grid is still moving and resizing. I know I can manually assign a no-move and no-resize data class but this defeats the purpose of the staticGrid flag.

Am I missing something? I am not programatically adding pieces, these were given a size and position at startup in HTML code; so I expected the static lock to work.

HTML

<!--WRAPPER--><div class="myGrid">
<div class="grid-stack"><!--START GRID--><div class="grid-stack-item" data-gs-x="0" data-gs-y="0" data-gs-width="6" data-gs-height="2"><div class="grid-stack-item-content clr1">Griditem1</div></div>
<div class="grid-stack-item" data-gs-x="6" data-gs-y="0" data-gs-width="6" data-gs-height="2"><div class="grid-stack-item-content clr2">Grid item2</div></div><!-- END GRID --></div>
<!--end wrapper--></div>

INIT

$(document).ready(function () {
  // start grid

   $(function () {
       var options = {
            verticalMargin: 3,
            staticGrid:true,
            cellHeight:'3.5em'
         };
        $('.grid-stack').gridstack(options);
    });
}); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions