fixedHeader with scrollY 's initially misaligned to 's
fixedHeader with scrollY 's initially misaligned to 's
arnoldjp57
Posts: 10Questions: 7Answers: 0
I have focused the cursor to the search field and as soon as any character is entered, the header aligns correctly. Sorting on any column also aligns the header. I have googled this and tried many many "fixes", but to no avail.
Here is the code
$(function() {
var table = $('#visis-table').DataTable({
processing: true,
serverSide: true,
ajax: '{!! url('datatables_thcas_p') !!}',
"columns": [{"visible": false,"searchable": false, data: 'id',name: 'id'},
{data: 'visi_patn.name', name: 'visi_patn.name',
"fnCreatedCell": function(nTd, sData, oData, iRow, iCol) {
$(nTd).html('<a href="#"' +
' onclick="fill_visi(\'' + oData.visisID + '\',\'' +
oData.visi_patn.name + '\')">' +
oData.visi_patn.name + '</a>');
{data: 'visi_patn.init', name: 'visi_patn.init'},
{data: 'filn', name: 'filn'},
{"searchable": false,"sortable": false, data: 'visi_dept.desc', name: 'visi_dept.desc'}, ],
"order": [[1, 'asc']],
"fixedHeader": true,
"scrollY": "450px",
"paging": false,
});
$('#modal-visi-select').on('shown.bs.modal', function () {
$('#visis-table_filter input').focus();
});
});
This discussion has been closed.
Answers
According to the FixedHeader documentation FixedHeader is not compatible with the DT scrolling features.
Kevin