** У меня есть DataTable на моей странице JSP.Данные таблицы будут заменены после вызова AJAX.Но после успешного вызова таблицы ajax не происходит сортировка.
Вот jquery с вызовом Ajax.
$(document).on('click','#Search',function (e){
$('#datatable').DataTable().destroy();
$('#datatable').DataTable({
processing: true,
serverSide: true,
ajax: {
url:'<%=contextPath%>/show/find/patient',
headers: {
'Authorization':'${sessionScope.token}'
},
data:{
"assignedMemberId": $("#assignedMemberId").val(),
"ssnLast4" : $("#ssnLast4").val()
},
type:'GET',
success:function(data){
console.log(data);
$('#patientDetails').html(data);
},
error:function(e){
console.log(e)
}
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="patientDetails">
<table id="datatable" class="table table-bordered dttble">
<thead>
<tr>
<th scope="col">Ticket</th>
<th scope="col">CP</th>
<th scope="col">First Name</th>
<th scope="col">Middle Name</th>
<th scope="col">Last Name</th>
<th scope="col">Enrolled On</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
Чего мне не хватает?Любое предложение будет очень полезным.