在jquery数据表上固定标题 [英] Fixed header on jquery datatables

查看:101
本文介绍了在jquery数据表上固定标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我尝试使用固定标题时,没有其他方法可以在jquery数据表上设置固定标题?



有警告,固定标题2不支持滚动数据表:(



有没有人知道如何修复?



这里是我的脚本:

 < script type =text / javascriptcharset =utf-8> 
$(document) (function(){
var oTable = $('#tabel_daftar_all')。dataTable({
bJQueryUI:true,
bPaginate:false,
// iDisplayLength:5,
//aLengthMenu:[[5,25,50,-1],[5,25,50,全部]],
//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滚动),而不是全页滚动。


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.

这篇关于在jquery数据表上固定标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆