Skip to content
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

BUG: Destroy() and re-intialize fails to allow draggable #148

Open
timothymarois opened this issue Aug 27, 2020 · 2 comments
Open

BUG: Destroy() and re-intialize fails to allow draggable #148

timothymarois opened this issue Aug 27, 2020 · 2 comments

Comments

@timothymarois
Copy link

The destroy method seems to work, bu when you try to add gridster back on, draggable elements are no longer functional, the grid resizes and aligns the widgets correctly, but they're no longer draggable.

The issue I came across is reactive data, so destroying when data is updated and rebuilding gridster with updated reactive data on the HTML end, was the plan, but looks like you can not add gridster back after destroying.

The console has no errors, something else has cut off from running.

Add widgets by HTML is ok, but being able to add widgets by outside source, where you can have gridster.refresh() would be really ideal for reactive data.

@timothymarois
Copy link
Author

Commenting this out in the gidster.js file on destroy()

if (this.drag_api) {
	this.drag_api.destroy();
}

Now dragging works when re-initializing. Though without further details, not sure whats going on with that if it will just leak memory over time. Looks like destroy does some damage to the drag API

@lwdsw
Copy link

lwdsw commented Sep 6, 2024

Hello, sir. This is invalid for me. Have you solved it now? I think I have no patience to debug this problem anymore. I'm about to give up. LOL~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants