jQuery数据表销毁

时间:2019-12-04 19:19:40

标签: javascript php jquery html

HTML

<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

 function fetch_data()
  {
   var dataTable = $('#user_WDdata').DataTable({
   "bPaginate": false,
   "info":     false,
    "processing" : true,
    "serverSide" : true,
    "order" : [],
    "ajax" : {
     url:"WDFetchData.php",

    }
   });
  }
});

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

我想破坏该数据表并通过fetch_data函数重新加载该数据表,但根本不破坏。我也在其他页面上执行此操作,在该页面上效果很好。发生了什么事?我做错了什么?

0 个答案:

没有答案
相关问题