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

Restrict items to certain sizes

Open indriemarius opened this issue 11 years ago • 1 comments

Hey,

Is there a way in the current API's functionality to restrict the size of an element to certain width-height pairs ?

For example, allow an item to be 1x2 or 2x2, but not 2x1. Or any other restrictions for that matter. Any different item to have different accepted sizes.

Thanks.

indriemarius avatar Sep 28 '15 18:09 indriemarius

Hey,

you can set it like this on the fly:

grid.min_width(widget,min_width);
grid.min_height(widget,min_height);

or add these attributes:

data-gs-min-width ="2"  data-gs-min-height ="1"

LevTaylor avatar Sep 28 '15 19:09 LevTaylor