Using dataTables with jquery.detailsRow.js plugin

Using dataTables with jquery.detailsRow.js plugin

michaelsmichaels Posts: 2Questions: 0Answers: 0
edited December 2009 in General
First, thanks a lot for this plugin, very customizable and easy starting to work with!!!

I've been reading this forum for some tip, but came up short trying to find a tip to make detailsRow plugin from here http://webworkflow.co.uk/plugins/detailsRow/ to work nicely with dataTables ... everything seem to work as expected first time datatables initialized, till sorting occurs ... after sorting invoked the detailsRow is lost and row show/hide no longer works. The question is how to make datatables to re-initialize detailsRow plugin and also remember to attach the hidden row that was added by detailsRow plugin?

Any help is appreciated.

Thanks,
Michael

Replies

  • allanallan Posts: 61,831Questions: 1Answers: 10,132 Site admin
    Hi Michael,

    Is there any reason for not using the built-in functions in DataTables for providing this effect (fnOpen and fnClose)? Here is an example of the built-in functions: http://datatables.net/examples/api/row_details.html . You can then combine this with Ajax or HTML or whatever you want when using these two functions.

    Having said that, it sounds like it might just be a problem with your event handlers not being attached to all rows:

    Example for adding event handlers post-initialisation: http://datatables.net/examples/advanced_init/events_post_init.html

    Bookmarklet for seeing what elements have event handlers attached: http://sprymedia.co.uk/article/Visual+Event

    Regards,
    Allan
  • michaelsmichaels Posts: 2Questions: 0Answers: 0
    Those are really great tips, thank you Allan!!!

    Cheers,
    Michael
This discussion has been closed.