is there no other ways to set fixed header on jquery datatables??
when i try using fixed header, there's warning that fixed header 2 is not supported on scrolling datatables :(
does anyone knows how to fix that??
here is my scripts:
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
var oTable = $('#tabel_daftar_all').dataTable( {
"bJQueryUI": true,
"bPaginate": false,
//"iDisplayLength": 5,
//"aLengthMenu": [[5, 25, 50, -1], [5, 25, 50, "All"]],
//"iDisplayStart": 5,
//"sPaginationType": "full_numbers",
"sScrollX": "100%",
//"sScrollXInner": "150%",
"bScrollCollapse": true,
"bFilter": false
} );
new FixedColumns( oTable, {
"iLeftColumns": 4,
"iLeftWidth": 350
} );
//new FixedHeader( oTable );
//$('#tabel_daftar_all').dataTable().rowGrouping();
} );
</script>
Currently no, FixedHeader is not supported with scrolling - I'm sure its perfectly possible to add that functionality, but as of yet, I've not had time to do so! Couldn't you just enable Y-scrolling? It achieves much the same effect, although its scrolling an inner element (which is already X-scrolling) rather than full page scrolling.
Remove the line
and fixedheader will then work
For implementing Fixed header in jQuery Datatable, Please add "FixedHeader.min.js" in page header and add following code to page:
Hope this will help you.
I had a use case, which needed scrollX, fixedColumn and fixedHeader. I could not find any solution. Moreover, as per Datatables, fixedHeader and fixedColumn are not compatible together. I solved this using custom JS and CSS.
This worked for me. Hope it helps :)