在Jquery DataTable中滚动问题 [英] Scroll issue in Jquery DataTable

查看:1404
本文介绍了在Jquery DataTable中滚动问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我是否重复的问题,如果是正确的地方的指导:)



我正在使用数据表,并尝试实现水平滚动并找到此链接



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



我在数据表代码中使用了这些属性,并在UI中出现问题。



我的数据有水平滚动条,但我的列没有展开,不能按预期方式工作。在我的正常列下方有额外的空列。



基本上我的UI被搞砸了我看到一个旧的线程讨论一样!



DataTables标题对齐问题



这些问题现在解决了吗?



=== ===========================



添加示例代码

  $(#results)。dataTable({
aaData:[
//我的数据
],
aoColumns:[
//我的列
],
bPaginate:true,
bSort:true,
bFilter:false,
bJQueryUI:false,
bProcessing:true,
sScrollX:100%,
sScrollXInner ,
bScrollCollapse:true
});


解决方案

我有一个类似的问题,不同的方式。



我修改了 sDom 参数,将表格包含在额外的 div

  sDom:'r<Hlf><datatable-scrollt> ;<Fip>',

然后我将以下样式应用于 .datatable-scroll class:

  / ** 
*如果它的容器太宽,表有水平滚动条
* /
.datatable-scroll {
overflow-x:auto;
overflow-y:visible;
}

http://datatables.net/usage/options#sDom


I am not sure if I am repeating the question if yes guide to the right place :)

I am using Data table and trying to implement Horizontal Scrolling and found this link

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

i used these properties in my Data Table code and am having issues in UI.

My data got the horizontal scroll bar but my columns didn't expand and not working as expected.i got additional empty column below my normal column.

Basically my UI is messed up. i saw a old thread discussion on the same!

DataTables header alignment issue

Are these issues fixed now any solutions ?

================================

Adding sample code

$("#results").dataTable({
    "aaData": [
        //My data
    ],
    "aoColumns": [
        //My Columns
    ],
    "bPaginate": true,
    "bSort": true,
    "bFilter": false,
    "bJQueryUI": false,
    "bProcessing": true,
    "sScrollX": "100%",
    "sScrollXInner": "110%",
    "bScrollCollapse": true
});

解决方案

I had a similar issue, but solved it in a different way.

I modified the sDom parameter to wrap the table in an extra div:

sDom: 'r<"H"lf><"datatable-scroll"t><"F"ip>',

I then applied the following styles to the .datatable-scroll class:

/**
 * Makes the table have horizontal scroll bar if its too wide for its container
 */
.datatable-scroll {
    overflow-x: auto;
    overflow-y: visible;
}

http://datatables.net/usage/options#sDom

这篇关于在Jquery DataTable中滚动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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