ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

Gridster is overlapping widgets when jquery ui is being used. #208

Closed xmikew closed 11 years ago

xmikew commented 11 years ago

Hello,

Ran across this issue when attempting to use gridster and jquery ui. In the jsfiddle if I remove jquery ui dialog and just stick with calling functions without the dialog, it works as expected.

To duplicate, click on "add grid" with a max col of 3 or whatever you want. Add some widgets.

Then add another grid with some widgets and then reorder the widgets in the 2nd grid. You'll see they start overlapping and go all goofy. It seems to manifest itself especially if you add a grid with max_col 3 then add a grid with max_col 1. Add a couple of widgets to the 2nd grid then sort the 2nd grid widgets.

http://jsfiddle.net/mKKXz/1/

You should see something happen like this:

gridster-overlap

From searching around on issues, I ran across this (issue 69) https://github.com/ducksboard/gridster.js/issues/69

which seems to be related. I attempted maxgalbu's fix but the issue was still present so not sure if it is the same issue. Feel free to make as dup if you think it is. I noticed that top was set to 0 on the second grid widgets, so it does seem related perhaps!

Thanks as always,

xmikew commented 11 years ago

Seems fixed in the dustmoo fork, however i believe what triggers the bug is trying to drag a widget to the last column of a row. In dustmoo fork, it just refuses to put a widget there. In ducksboard, it does the funky overlap craziness.

- Mike

xmikew commented 11 years ago

I don't think this is fixed in dustmoo's fork. Just doesn't manifiest itself the same way. All Gridster instance options are getting overwritten by the last gridster instantiated which is causing calculations using max_cols to go wacky. (hypothesis)

- Mike

xmikew commented 11 years ago

The extend of options causes this and not jquery ui as far as I can tell. This may be by design. If you want multiple grids with independent options the extend should be changed to extend({}, defaults, options). Warning: not thoroughly tested.

simplenotezy commented 10 years ago

I am experiencing the exact same problem - any solution to this?