Dynamic reload of datatable causes TableTools troubles

Dynamic reload of datatable causes TableTools troubles

ljantzenljantzen Posts: 6Questions: 0Answers: 0
edited November 2012 in General
I posted this question as a comment in this thread -> http://datatables.net/forums/discussion/comment/40977 but noone answered so I am trying again.

http://live.datatables.net/arucaq/21 displays the issue I am having quite nicely. Click on the big red button to reload the table, and the javascript console emits the error message "Uncaught TypeError: Cannot read property '_DTTT_selected' of undefined"

Any ideas on how to solve this issue will be hugely appreciated.

Replies

  • ljantzenljantzen Posts: 6Questions: 0Answers: 0
    Eh, to clarify: The error is emitted when one attempts to select a row in the result set by clicking on it, after the reload.
  • ljantzenljantzen Posts: 6Questions: 0Answers: 0
    Don't know if it is considered bad form to ping a forum post, but I'd really appreciate some form of response to this issue. Please respond if you need more clarifications or details.

    Thank you.
  • allanallan Posts: 63,204Questions: 1Answers: 10,415 Site admin
    No bad form as such - its just that with 30-40 posts a day, it has become impossible for me to keep up and reply to every post!

    Unfortunately TableTools destroy method is rather lacking - so when you destroy the table TabletTools isn't correctly unbinding itself. Thank you for providing an example of this - it was really helpful!

    I've committed a change to TableTools to address the issue - I've updated your example to use the currently nightly here: http://live.datatables.net/arucaq/22/edit .

    The nightly can be downloaded from http://datatables.net/download (2.1.5.dev) or from the git repo's head.

    Regards,
    Allan
  • ljantzenljantzen Posts: 6Questions: 0Answers: 0
    Excellent news. I will download the nightly and test it out in my environment in a day or two. Thanks a million!
  • ljantzenljantzen Posts: 6Questions: 0Answers: 0
    That fix worked beautifully. Angain, thanks!

    Leif.
This discussion has been closed.