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

Add widget pushes existing too far down / Is there a manual trigger to reposition widgets

Open WhiskeyJack opened this issue 11 years ago • 6 comments

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?

WhiskeyJack avatar Jun 20 '13 09:06 WhiskeyJack

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.

WhiskeyJack avatar Jul 03 '13 15:07 WhiskeyJack

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

dustmoo avatar Jul 03 '13 16:07 dustmoo

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.

WhiskeyJack avatar Jul 04 '13 09:07 WhiskeyJack

Hmm, guess that was too optimistic. Problem is back with the source files :( No idea why it worked just a moment ago.

WhiskeyJack avatar Jul 04 '13 09:07 WhiskeyJack

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 avatar Jul 04 '13 09:07 WhiskeyJack

@WhiskeyJack Thanks a lot, commenting this.empty_cells(col, row, size_x, size_y); was really useful to me!

sembee83 avatar Dec 06 '16 14:12 sembee83