hi,
datatable pagination not working with ajax call
$(document).ready(function() {
$("#btnGet").click(function () {
$.ajax({
url: "/Stocks/StockList2",
data: JSON.stringify({ model: stockModel }),
type: "Post",
contentType: "application/json;charset=UTF-8",
dataType: "Json",
success: function (data) {
let htmlTable = "<table class='table table-striped table-hover'><tr><th>Name</th>Details<th>Group</th></tr>";
$.each(data, (index, value) => {
htmlTable += '<tr><td>' + value.stokKod + '</td><td>' + value.stokName + '</td><td>' + value.grupKod + '</td></tr>';
});
htmlTable += "</table>";
$("#tblCustomerList").html(htmlTable);
}
});
});
});
$(document).ready(function() {
$('#tblCustomerList').DataTable({
destroy: true,
processing: true,
select: true,
paging: true,
lengthChange: true,
"lengthMenu": [[13, 25, 50, -1], [13, 25, 50, "All"]],
searching: true,
"order": [],
info: false,
responsive: true,
autoWidth: false
})
})