使用 jquery Mobile 的 DataTable 水平滚动不起作用

use*_*015 2 css datatables jquery-mobile intel-xdk

当将数据表与 jquery mobile 一起使用时,我似乎无法让水平滚动条运行。我已经尝试了我能想到的 sScrollX 和 sScrollY 的所有组合。

要查看缺少垂直滚动条的示例,请尝试我在此处放置的 Web 应用程序示例。

在 iPhone 或其他小屏幕上尝试以下操作:

1) 将滑块从图表切换到表格 2) 点击收藏夹按钮 3) 向下滚动左侧面板并选择“MSFT”。

您只会看到前几列。您可以上下滚动,但不能向右滚动。

我尝试了 sScrollX 和 sScrollY 但滚动不一致并且有错误。目前我已经禁用了两者,至少垂直滚动可以正常工作。

任何帮助将不胜感激,因为我已经为此奋斗了一个星期了!

请在下面找到当前数据表代码:

 var table = $('#table_container').dataTable( {
        "symbol": symbol,
        "exchange": exchange,
        "aoColumns": columnData,
        "aoColumnDefs": [
        { "aTargets": [0],      "mRender": function (data, type, full) {return dateFormat(data)} },
        { "aTargets": [1],      "mRender": function (data, type, full) {return volumeNumber(data)} },
        { "aTargets": [8],      "mRender": function (data, type, full) {return volumeNumber(data)} },
        { "aTargets": [14],      "mRender": function (data, type, full) {return volumeNumber(data)} },                           
        { "aTargets": ["_all"], "mRender": function (data, type, full) {return numberWithCommas(parseFloat(data).toFixed(2))} },
        ],
        "aaSorting": [[ 0, "desc" ]],
        "bPaginate": false,
        "bLengthChange": false,
        "bFilter": false,
        "bInfo": false,
        "bAutoWidth": false,
        "bProcessing": true,
        //"sScrollX": "100%",
        //"sScrollY": "100%",
        //"sDom": 'r<"H"lf><"datatable-scroll"t><"F"ip>',                        
        "bScrollCollapse": false,
        "bServerSide": true,
        "sAjaxSource": str,
        "bDeferRender": true,
        "fnServerData": function( sUrl, aoData, fnCallback ) {
            $.ajax( {
                "url": sUrl,
                "data": aoData,
                "success": fnCallback,
                "dataType": "jsonp",
                "cache": false
            } );
        }
    } );
Run Code Online (Sandbox Code Playgroud)

Ara*_*vin 6

尝试这样

$(document).ready(function() {
    $('#example').dataTable( {
        "sScrollX": "100%",
        "sScrollXInner": "110%",
        "bScrollCollapse": true
    } );
} );
Run Code Online (Sandbox Code Playgroud)

参考这个小提琴演示