Column name in dynamic table stay permanenently

Column name in dynamic table stay permanenently

tsurubasotsurubaso Posts: 6Questions: 2Answers: 0

code part :
https://pastebin.com/7WLY5t6v
Visuals to understand the problem:

Debugger code (debug.datatables.net):
Error messages shown:
There is no alert or error message

Description of problem:

From the code, the column name should be erase and reinitialized but they stay.
I am new to datatables, I have surely missed something.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 14,171Questions: 25Answers: 3,343
    edited October 9 Answer ✓

    Looks like you need to include a call to jQuery empty(). See the second example in the destroy() docs.

    Kevin

  • tsurubasotsurubaso Posts: 6Questions: 2Answers: 0

    @kthorngren Thanks, I will check your answer!!!

  • tsurubasotsurubaso Posts: 6Questions: 2Answers: 0
    edited October 10
    if ($.fn.DataTable.isDataTable('#searchTable')) {
    
        $('#searchTable').DataTable().clear().destroy();
        $('#searchTable').empty();
     }
    

    Made it work,
    super thanks

Sign In or Register to comment.