gridster.js
gridster.js copied to clipboard
Add widget pushes existing too far down / Is there a manual trigger to reposition widgets
For some reason when I add a widget to my grid, it pushes the existing widget(s) in that column to row 12 leaving row 3-11 empty (in case of a 2 row widget). If I then add another one, then new one pushes the previous one to row 12 and all the existing ones shift below that, keeping row 3-11 empty. When I move one of the lower widgets, it will snap back up after release to row 3.
I don't think I have had this problem before, but is there a way to trigger a reposition of the all the widgets so that they will shift upward to cover the empty rows?
Nobody else encountered this? I found a similar issue here https://github.com/ducksboard/gridster.js/issues/156 but I have not com across a solution.
Hi whiskey, I just launched my big project and will have some time after te holiday to pickup Gridster. I'll see what I can find.
On Wed, Jul 3, 2013 at 8:19 AM, WhiskeyJack [email protected] wrote:
Nobody else encountered this? I found a similar issue here https://github.com/ducksboard/gridster.js/issues/156 but I have not com across a solution.
Reply to this email directly or view it on GitHub: https://github.com/dustmoo/gridster.js/issues/20#issuecomment-20422330
Thanks!
Although I don't do much with javascript, I thought I would give it a shot to see what I could find. Turns out that if I included the src version files instead of the dist version the problem was gone! jquery.gridster.min.js shows as version: gridster.js - v0.1.0 - 2013-04-03.
Hmm, guess that was too optimistic. Problem is back with the source files :( No idea why it worked just a moment ago.
Ok, problem remains but as a workaround I commented out the line that adds empty cells (line 172: this.empty_cells(col, row, size_x, size_y); ) and make sure I manually add widgets in only places where they will fit.
I can share the code that looks up a free position if somebody is interested, but be warned because it is ugly ;-)
@WhiskeyJack Thanks a lot, commenting this.empty_cells(col, row, size_x, size_y); was really useful to me!