Destroy function is not working in safari browser

Destroy function is not working in safari browser

jinesh.mjinesh.m Posts: 1Questions: 1Answers: 0

When i use destroy function to destroy already existing datatable object it shows an error like "TypeError: 'undefined' is not a function" . It happens in only in safari browser. how can i solve this?

Answers

  • AshbjornAshbjorn Posts: 55Questions: 2Answers: 16
    edited July 2015

    Hi jinesh.m,

    Make sure you are calling your destroy after you have initialized your table.

    $( document ).ready(function() {
        var table = $('#example').DataTable({
             //options to initialize your datatable properly
         });
    
        $('selector').on('event', function () {
            table.destroy();
        }
    });
    

    Hope this helps,

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    @jinesh.m - if @Ashbjorn's suggestion doesn't help, please link to a test case showing the issue, as per the forum rules, so we can debug it. This example appears to work just fine in Safari for me.

    Allan

This discussion has been closed.