$('#targettable').dataTables.destroy() does not work where as fnDestory works well.

$('#targettable').dataTables.destroy() does not work where as fnDestory works well.

SunilgoelSunilgoel Posts: 48Questions: 19Answers: 0

Hi Support,

//this does not work
$('#targettable').dataTable().destroy();
$('#targettable').empty();

//if changed to fnDestory then this works,

$('#targettable').dataTable().fnDestroy();
$('#targettable').empty();

Please look this issue and help me to resolve this.

Regards.
Sunil

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    $('#targettable').dataTable().destroy();

    That will give an error because it should be:

    $('#targettable').DataTable().destroy();
    

    Note the change in the case. I think I make that change yesterday, but it is possible I missed it.

    The explanation for this is available in the FAQs.

    Allan

This discussion has been closed.