繁体   English   中英

使用jQuery DataTable制作可滚动的内容

[英]Make a scrollable content with jquery datatable

有什么办法可以使jQuery datatable的滚动内容?

这是我的脚本:

oTable = $('#tablex').dataTable
    ({
        "sDom": "<'scrollContent't>T<'fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix'lfr>t<'fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix'ip>",
        "bJQueryUI": true,
        "aoColumns": [
        null,
        null,
        { "sType": "formatted-num" },
        { "sType": "formatted-num" },
        { "sType": "formatted-num" },
        { "sType": "num-html" },
        { "sType": "num-html" }],
        "aLengthMenu": [[10, 15, -1], [10, 15, "All"]],
        "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
        /* Bold the grade for all 'A' grade browsers */
            var index = iDisplayIndex +1;
            $('td:eq(0)',nRow).html(index);
            return nRow;
        }
    });

当我在firefox 3.6.19中尝试过时,它看起来很好,但是当我在firefox 5.0.1中尝试时,它不行了@。@我的脚本有什么问题吗? 也许有人可以帮我吗? 谢谢..

数据表提供了一种设置可滚动内容大小的方法。

"sScrollY": "200px",

http://www.datatables.net/examples/basic_init/scroll_y.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM