数据库用于检索数据时不显示功能

时间:2017-11-19 06:51:34

标签: ajax datatables

<table id="datatable-buttons" class="table table-striped table-bordered">
  <thead>
    <tr>
      <th hidden>ID</th>
      <th>Full Name</th>
      <th>Age</th>
      <th>Address</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>

enter image description here

$(document).ready(function(){ retrieve_user() });

当我从数据库中检索数据时,未显示功能。如果我从数据表功能单击导出按钮,它不会显示数据

function retrieve_user(){
  $.ajax({
    url:'../conn/callFunc.php',
    method:'POST',
    data:{
      _trans:'retrieve_user'
    },
    success:function(msg){
    $(function () {
      $('#datatable-buttons').DataTable();
    })
        $("#datatable-buttons tbody").html(msg);

          }
    })
}
</script>

0 个答案:

没有答案