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

Gridster loading is really really long since 0.5.2 #446

Open lgm42 opened 9 years ago

lgm42 commented 9 years ago

I'm using gridster from version 0.2 and I would like to update my too old version to benefit from new version.

But when I make an update Gridster is extremely slow and make my CPU goes up to 100% during 30 - 60 seconds each time I load the page.

I search the last working version and what make the difference. The last usable version for moy app is 0.5.1.

And the modification that make the gridster goes to slow is fix add_widget to use correct size_y when adding rows ([https://github.com/ducksboard/gridster.js/commit/7d22e6c8b201de33e33def77a93dc9009d0aa4cb])

When I remove these two line, gridster works well. Any idea of the problem ?

Daijobou commented 9 years ago

I use 0.5.6 and have no problems with add_widget and speed, but with remove widgets. ;) https://github.com/ducksboard/gridster.js/issues/406

add a jsfiddle, to see your problem live.

lgm42 commented 9 years ago

It's very difficult for me to post a js fiddle because I'm using gridster in a Web application with a lot of dynamic function that depend on a Custom Web server application.

So I havn't any static page with gridster inside. I've just seen that if I remove that modification from the code it is ok and if i let this modification it is very very slow

mobichel commented 9 years ago

Hi lgm42,

I faced with same issue after upgrading to Gridster 0.5.2. Previously add_faux_rows() was called with undefined and we have no such problem.

Now add_faux_rows() method accepts size_y passed to add_widget() method. If you pass size_y as string it leads to incorrect calculation inside add_faux_rows() and your page become unresponsive.

Try to pass size_x and size_y as numbers when call add_widget method to solve this issue.

harshmsp commented 9 years ago

I am facing same problem, but no any solution. Can you please help me how can we reduce the time to load widget. I am binding just 12 column / 10 rows widget and takes huge time. Please help.

I have tried with gridster.add_widget and gridster.add_widget.apply method with passing row and column and without that. But no solution.