Datatable Destroy Not Working

Datatable Destroy Not Working

stutstut Posts: 7Questions: 3Answers: 0
edited December 2019 in Free community support

html code

<table class="table" id="user_WDdata">
                    <thead class=" text-primary">
                    <tr>
                      <th>
                        Email
                      </th>
                        <th>
                        Wallet Addr
                      </th>
                          <th>
                        Amount
                      </th>
                          <th>
                        Apply Date
                      </th>
                      <th >
                        status
                      </th>
                      <th>
                       Message
                      </th>
            <th>Action</th>
            </tr>
            </thead>
          </table>

jquery code

 success:function(data)
     {
      $('#MsgModal').modal('toggle');
      $('#alert_message').html('<div class="alert-success">'+data+'</div>');
      $('#user_WDdata').DataTable().destroy();
      fetch_data();
     }

i want to destroy this datatable and reload the datatable through fetch_data() but is not destroying at all. what has happend? what i have done wrong

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.