-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlapping issues caused by "add_widget" #340
Comments
@canfiax let me know if it fixes your problem. I had the same issue and it fixed mine. |
Hello Adrian! We're very happy to see your interest in helping out on the issue. I copied this file and replaced it with the original gridster.js: https://raw.githubusercontent.com/AdrianTeh/gridster.js/72669b0cf6ae5370c1f6624fb7c74e11e6f3a3ee/dist/jquery.gridster.js However, it caused the page to "crash". It would simply not load, and Chrome would say the page is not responding. I have created an example for you to see. The gridster (with overlapping issues): The gridster with your update: |
@canfiax Looking at the 1st link you provided, I do not see any overlapping issues, unless I'm looking at it wrongly. As for the crash, I don't think the minor update would have caused the issue. It's working well on my app using the fix. Make sure you are using both the latest JS and CSS dist files. Hope you get your problem fixed soon :) |
Hi Adrian! The update you sent really does trigger the error. try to reproduce the problem as described in top of the thread. That is how they get to overlap. The grid I sent you is simply a lucky way we found, where they do not overlap. As soon as you begin dragging, they'll overlap. |
@canfiax I suggest you setup a mini testing site that uses the gridster.js with the new fix I've added. Try and see if it works / crashes. It works well on my side and other sites as well. It might be the way you're adding the widgets or the configurations you've set on the plugin. The fix i've posted only fulfills what the plugin function require on line 1050:
The rest is as per the plugin. A fix, might have reveal problems in other areas that might not have occurred, before the previous fix :) |
I have narrowed down the problem. This line:
Produces a heavy amount of lag. Like seriously a lot. EDIT: Trying without the X and Y coordinates, it does not lag. Hmmm. UPDATE 2: I have tried running
in console, to see the difference. They are quite different. Maybe it can help you. I have created an image here - the red marks highlights the difference between the working/nonlaggy version and the new one. When running
In 'gridster2'
to
This seems to be what is causing the lag. (In the 03-13-2014 version, it changes from "faux_grid: Array[69]" to faux_grid: Array[90]" which is WAY lower.) |
I think I have the same issue I also use add_widget, and it seems that at some point during this process vertical positioning goes all wrong.. |
Update (work around).. |
I just commited a pull request: #426 which solved my problem: (#425). I also experienced lots of lags, after this change it flies again :-) To try it out: Change: in the function add_faux_rows. Let me know your results. |
This fixed the issue for us!! Great! |
@canfiax Good to hear, hope it gets pulled soon. |
Hello All, Even i have the same widget overlapping issue.overlapping is happening when i am trying to add widgets of different sizes at the same time. tried using faux parseInt ,it doesn't work for me. Any solutions are appreciable. |
This is definitely still a problem. Adding widgets currently causes the browser to freeze for me when re-adding serialized widgets. |
* AdrianTeh/gridster.js.git/master: fixes-add-widget-overlapping-issue-ducksboard#340
For a very long time I been fighting against the overlapping issues on gridster. I feel stuck. I have tried everything. The startup I am in is very dependent of the gridster, as it is our only really selling point for our clients ("get a nice drag'n'drop profile"). Please, if you have ANY suggestions, let us know.
We are currently v0.5.1.
I have tried to narrow down the problem. I have concluded which line seems to produce the error, which is: add_widget();
The grid looks like this:
When calling this function:
It looks like this (exactly as it should. Added to bottom, and still in grid):
As soon as I call it a once more, the grid boxes will be messed up. See:
I noticed that on first time i run it, the added grid box has “data-row” set to “29”. The second time I run the function, the added grid box has “data-row” set to “17”.
See:
Also, when calling $(‘.addNewwidget’), I notice that the ‘data-row’ has changed to “24" (originally “29”). See:
Any ideas? I am lost.
If you're curious and like to see it for your self - let me know - I'll can give you a test account, where you can experience the issues for your self.
The text was updated successfully, but these errors were encountered: