Skip to content Skip to sidebar Skip to footer

Uncaught TypeError: $.fn.DataTable.isDataTable Is Not A Function

I am using a data table to display data from database and i can perform delete and edit actions.with below code i am able to fetch data from database and perform edit and delete. b

Solution 1:

For your question, since you set table = $('#sun_project_table').DataTable({...}); when you initialize the table, thus if you want to check if the table exists before you destroy it, you can just do

if(table) {
   table.destroy();
   ...
}

But I agree with other comment, if you just want to refresh the table, you can just remove the row, or clear the table and fetch it again via ajax.


Post a Comment for "Uncaught TypeError: $.fn.DataTable.isDataTable Is Not A Function"