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

Auto-repositionning?

Open metalheadz opened this issue 9 years ago • 7 comments

Is there a way to auto reposition all the element after using the resize function without manually reposition each nodes? When I resize a node making it bigger in width, it always push the next node at the bottom even if theres enough space.

metalheadz avatar Sep 29 '17 18:09 metalheadz

Do you mean adding float: false to the Gridstack options?

DnJealt avatar Oct 02 '17 14:10 DnJealt

I don't think that's what he means... http://gridstackjs.com/demo/two.html if you resize the first one and make it wider, it doesn't push the 2 more to the right to fit, it pushed # 2 down... I'm guessing he wants push right, then next row if doesn't fit... (grid on right has float on, but behaves same way here)

adumesny avatar Oct 03 '17 04:10 adumesny

I found a way to do it... I remove all the nodes from the grid with removeall keeping them in the DOM... I after add manually each component using the autoposition parameters... Not so elegant... Would be nice if another option exists to do that... Pushing nodes at the bottom is very bad when you dont want to loose precious space

metalheadz avatar Oct 03 '17 14:10 metalheadz

you want a left-right gravity, where right now it's a top only gravity - there has been suggestion to support multiple style by others (and @radiolips mention this might make it in 1.0 release but I wouldn't bank on it).

adumesny avatar Oct 03 '17 15:10 adumesny

I want a mix of the 2 in fact, when theres not enough space at the right, its ok to push the node at the bottom, begining at the left again.

metalheadz avatar Oct 04 '17 12:10 metalheadz

Oddly enough, #796 requests that exact feature.

radiolips avatar Oct 15 '17 19:10 radiolips

I'm closing this in favor of #796, but please watch 796 if you'd like to keep in the loop.

radiolips avatar Feb 12 '18 20:02 radiolips