-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Grid destroy() Does Not Remove Listeners #2213
Comments
Update: what resolves the issue (as a workaround) is the following: widgetsGrid.destroy(true); if(domElementForGridStack) { domElementForGridStack.remove(); } domElementForGridStack = document.createElement("div"); domElementForGridStack.className = "grid-stack"; GridStack.init(options, domElementForGridStack); So essentially passing Is the above expected behavior, or should |
can you please post a jsfiddle equivalent showing the issue as the bug report ask for ? |
grid.destroy(false) should work - leave dom element behind but still remove any GS stuff including events |
closed in next release. if you find this lib useful don't forget to donate! |
When destroying and recreating a grid that previously had a listener on it, the listener does not appear to be removed. Please see the following example code. The code below is called against an existing grid that needs to be recreated (SPA use-case):
The above "added" event runs twice after the grid is destroyed and recreated with the above code. Shouldn't destroy remove the listeners as well? If not, how do you remove the listeners when destroying the grid?
The text was updated successfully, but these errors were encountered: