gridstack.js
gridstack.js copied to clipboard
Restrict items to certain sizes
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.
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"