DataTable({bRetrieve:true}).destroy() no longer work with dt-1.10.12 & updated extensions

DataTable({bRetrieve:true}).destroy() no longer work with dt-1.10.12 & updated extensions

GeHGeH Posts: 6Questions: 2Answers: 0

I'm

This question has an accepted answers - jump to answer

Answers

  • GeHGeH Posts: 6Questions: 2Answers: 0
    edited May 2016

    I'm using this code to create and re-create a datatable :

    $('#info_other_spe_table').DataTable({bRetrieve:true}).destroy();
    $('#info_other_spe').html('<table id="info_other_spe_table" class="display compact" width="100%" cellspacing="0"></table>');
    

    It was working nicely with previous datatables version & jquery 2.2.3 :

    //cdn.datatables.net/t/dt/dt-1.10.11,b-1.1.2,b-html5-1.1.2,sc-1.4.1,se-1.1.2/datatables.min.js

    With the last release & jquery 2.2.3 :

    //cdn.datatables.net/u/dt/dt-1.10.12,b-1.2.0,b-html5-1.2.0,sc-1.4.2,se-1.2.0/datatables.min.js

    this code throws an error when the datatable already exists, and the datatable's bindings aren't fully destroyed.

    I cannot provide easily a test case, if anyone as a tip or a similar problem it may helps.

    Stack trace :

    TypeError: a[b] is undefined
    .destroy()
     datatables.min.js:187
    ._constructor/<()
     datatables.min.js:190
    n.event.dispatch()
     jquery-2.2.3.min.js:3
    n.event.add/r.handle()
     jquery-2.2.3.min.js:3
    .trigger()
     jquery-2.2.3.min.js:4
    .trigger/<()
     jquery-2.2.3.min.js:4
    .each()
     jquery-2.2.3.min.js:2
    n.prototype.each()
     jquery-2.2.3.min.js:2
    .trigger()
     jquery-2.2.3.min.js:4
    u()
     datatables.min.js:87
    <anonyme>
     datatables.min.js:149
    .iterator()
     datatables.min.js:111
    <anonyme>
     datatables.min.js:148
    r.extend/g/<()
     datatables.min.js:114
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Its a bug in Buttons I'm sorry to say. I've misplaced the other thread on this topic, but will find it and post back here and there when I've committed the fix and will publish an updated package (probably later today) with the fix.

    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    I've just committed the fix and the nightly version now has the change in it. Could you try it and let me know how it goes for you (it should be plain sailing!).

    When confirmed I'll release 1.2.1 with just that change.

    Thanks,
    Allan

  • GeHGeH Posts: 6Questions: 2Answers: 0

    I confirm that the nightly version is working for me.
    No other flaw detected.

    Thanks,
    Gérald

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Released now and available in the download builder and NPM.

    Thanks for the feedback on this issue!

    Allan

This discussion has been closed.