$('#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: 52,290Questions: 1Answers: 7,966 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.