Here is what I want to do: I’m using gridster in order to create a form creation IDE. The user drags elements in the grid, and can move them around.
Everything works great inside the editor, but when I try to use those forms but I’m having issues when the elements inside the grid positions become bigger than the grid block that contains them, making one element overlapping another.
What I’m looking for is an automated solution that when given a bunch of absolute positioned elements, it moves them up or down so they don’t overlap. Does such thing exist?
I made a workaround myself
I wrote this code, and put it inside an interval that loops all the time, making the elements that belong to the same column not overlapping.
Take note that the
.gs_wis the class of the gridster grid cell which contains the.form_rowwhich in turn contains the input element itself and shrinks to fit it.Finally this won’t work if dragging is enabled, which in my case is ok because only the form editor I built utilises dragging. Not the forms themselves.
Any suggestions or improvements are welcome!