使用fixedColumn进行数据表滚动x问题

时间:2015-09-30 12:49:37

标签: scroll datatable datatables

使用带有fixedColumns的jquery数据表。一切正常,但我有滚动x的问题。

enter image description here

正如您所见,我无法从固定列中删除滚动x。任何解决这个问题的想法?初始化:

$(document).ready(function(){
    var oTable = $('#matriz').dataTable({            
        "bStateSave": true,
        "iCookieDuration": 60*60*24*30*365,
        "sDom": 'TC<"clear">lfrtip',
        "oTableTools": {
            "sSwfPath": "//cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf",
            "aButtons": [
                {
                    "sExtends": "xls",
                    "sButtonText": "Excel",
                    "mColumns": 
                        [ 
                            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
                            13, 14, 15, 16, 17, 18, 19, 20, 21, 22
                        ]
                }
            ]
        },   
        "aoColumnDefs": [
            { 'bSortable': false, 'aTargets':
                [
                    8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23 
                ] 
            }
        ],            
        "pagingType": "full_numbers",            
        "oLanguage": {
            "sInfo": "Exibindo de _START_ até _END_. Resultados encontrados: _TOTAL_",
            "sSearch": "Pesquisar: ",
            "sEmptyTable": "Não existem solicitações para exibir.",
            "sLengthMenu": "Visualizar _MENU_ solicitações",
            "oPaginate": {
                "sFirst": "Primeira",
                "sLast": "Última",
                "sNext": "Próxima",
                "sPrevious": "Anterior"
            }
        },            
        "oColVis": {
            "buttonText": "Ocultar colunas",
            "bRestore": true,                        
            "aiExclude": [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23 ],
            "sRestore": 'Restaurar'
        },            
        "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Todas"]],
        "iDisplayLength": 10,
        scrollY:        325,
        "sScrollX": "100%",
        scrollCollapse: true,
        fixedColumns:   {
            leftColumns: 1
        }            
    });
    setTimeout(function (){
        oTable.fnAdjustColumnSizing();
    }, 10 );        
});

1 个答案:

答案 0 :(得分:0)

将overflow-x:hidden添加到DTFC_LeftBodyLiner div似乎可以解决显示问题。