-
Notifications
You must be signed in to change notification settings - Fork 55
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
How to reinitialise plugin if DOM changes? #27
Comments
Did you ever find a solution to this? I have the same issue. Tabs update the content via ajax, once that has happened the filter no longer works |
I have the same issue. Do you know how to solve it? Thanks |
Put your initial filter init code in a function. Run this function whenever you need it. Also using jQuery UI draggable, I run the function when an element s dropped in another div.
call this whenever you need it |
@donShakespeare i think the problem in your solution is that all elements are cached each time you call that function. So if you call that function multiple times the overall javascript performance will drop depending on how many elements there are and how often the function was called … |
I note from the source code that the variables
lis
andlen
are cached, and the comments in the code suggest reinitialising the plugin if the DOM changes after the plugin is first initialised.Is there a fork of this code which doesn't cache those variables?
Alternatively, how can I reinitialise the plugin if the DOM changes subsequent to the plugin initialising?
The text was updated successfully, but these errors were encountered: