Reattach DataTables after AJAX load?
Reattach DataTables after AJAX load?
So I am trying to figure out how to reattach my DataTables event handlers to tables that have been called up through AJAX (not just the data, whole tables). I'm pretty new to AJAX and all this event handler stuff, so I'm slowly working my way through. Any help would be greatly appreciated!
This discussion has been closed.
Replies
Two options:
Using fnGetNodes to get a node array that you can attach events to: http://datatables.net/examples/advanced_init/events_post_init.html
Using jQuery Live events: http://docs.jquery.com/Events/live#typefn
You might find this bookmarklet useful for dealing with debugging of events (seeing if they are attached or not): http://sprymedia.co.uk/article/Visual+Event
Regards,
Allan