When I call my function for the first time the jquery functions is working properly, but if I call the same function once again without refrshing the page the data table functions are not working.
If I change the length to false it is working perfectly.
table = $('#contenttableTemplate').DataTable({
"retrieve": true,
"paging": true,
"responsive": true,
"fixedHeader": true,
"lengthChange": true,
"lengthMenu": [
[5, 10, 25, 50, -1],
[5, 10, 25, 50, "All"]
],
"pageLength": 5,
"order": [
[5, "desc"]
],
"columnDefs": [{
"orderable": false,
"targets": 0
}],
"deferRender": true,
"scrollX": true,
});