Cannot read property 'isDataTable' of undefined?

Cannot read property 'isDataTable' of undefined?

ShahiDevShahiDev Posts: 16Questions: 7Answers: 0
   if ($.fn.DataTable.isDataTable("#datatable")) {
        $('#datatable').DataTable().clear().destroy();
    }

When i compile it, it gives me error, Cannot read property 'isDataTable' of undefined! what is the solution?

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    The solution is to use the correct case - see $.fn.dataTable.isDataTable()

    $.fn.dataTable.isDataTable()
    

    Note the first lower-case 'd'

  • ShahiDevShahiDev Posts: 16Questions: 7Answers: 0
    edited September 2018

    @colin It was not a typo error, there is nothing wrong with my syntax. i've solved it, there was problem in configuring it. thanks for your reply.

This discussion has been closed.