Reputation: 27
I am having issues, using DataTable filled by an ajax request and when I load other tables in the pages via ajax, I got duplicate fixed header, for every table a new fixed header.
I am using ajax to load every page. This is datatable script/code :
table = $('#' + id).DataTable({
fixedHeader: {
header: true
},
"bRetrieve": true,
"processing": true,
"serverSide": true,
"order": [],
"ajax": {
"url": url,
"type": "POST"
},
searchHighlight: true,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'All']],
"oLanguage": {
"sProcessing": '<i class="icofont icofont-downloaded"></i> LOADING',
"sZeroRecords": '<span class="appsnay-color-datatable-no-data"><i class="fa fa-info-circle"></i> Tidak ada data untuk ditampilkan dari kata kunci pencarian</span>',
"sInfo": '<span class="appsnay-label-datatable">Total <strong class="label label-default pas plm prm mas">_TOTAL_</strong> (_START_ - _END_)</span>',
"sLengthMenu": 'Show _MENU_ ',
"sInfoEmpty": '<span class="appsnay-label-datatable-no-data"><i class="fa fa-info-circle"></i> Tidak ada data ditemukan</span>',
"sInfoFiltered": " <span style=\"color: blue\"> [ _MAX_ Total data ]</span>",
"sSearch": '<i class="fa fa-search"></i> Search ',
"sEmptyTable": '<span class="appsnay-color-datatable-no-data"><i class="fa fa-info-circle"></i> Belum ada data</span>',
"oPaginate": {
"sNext": '<small>→</small>',
"sLast": '<small>Terakhir</small>',
"sFirst": '<small>Pertama</small>',
"sPrevious": '<small>←</small>'
}
},
"columnDefs": [
{
"targets": 'no-sort',
"orderable": false
}
]
});
Upvotes: 0
Views: 256