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.04k stars 1.2k forks source link

When doing an add_widget it takes very long and the gridster.rows becomes a string? #425

Open rept opened 10 years ago

rept commented 10 years ago

I have a grid (layout) with 3 widgets on it. On is positioned on col/row: 1,1 with size: 2, 39 the other 2 are at col = 3.

Then I want to add another widget. Before I do that when I ask the rows. I'm getting this:

layout.rows
=> 339

I then do this: layout.add_widget('<li id="layoutComp_4 class="layout_block gs-w" data-id="top_project_list"/>', 2, 39, 1, 1);

It takes a couple of seconds before it appears, and when I then check the rows again, I'm getting this:

layout.rows
=> "33939"

So it suddenly becomes a string?

What am I missing here? It doesn't matter if I add the widget at 1, 1 or at 1, 40 (which should be empty).

rept commented 10 years ago

Solved this with pull request: https://github.com/ducksboard/gridster.js/issues/426 which solved my problem.