Reattach DataTables after AJAX load?

Reattach DataTables after AJAX load?

Gremlyn1Gremlyn1 Posts: 14Questions: 0Answers: 0
edited December 2009 in General
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!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Gremlyn1,

    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
This discussion has been closed.