问题描述
有没有其他方法可以在 jquery 数据表上设置固定标头??
is there no other ways to set fixed header on jquery datatables??
当我尝试使用固定标题时,会出现滚动数据表不支持固定标题 2 的警告:(
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??
这是我的脚本:
<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>
推荐答案
目前不,FixedHeader 不支持滚动 - 我确信添加该功能是完全可能的,但到目前为止,我还没有时间这样做!你不能只启用 Y 滚动吗?它实现了大致相同的效果,尽管它滚动的是内部元素(已经是 X 滚动)而不是整页滚动.
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.
这篇关于修复了 jquery 数据表上的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!