Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82581

Bug with table headers and vertical scroll bar (plunker + potential fix)

$
0
0

Hi All(an),

Noticed an issue with the datatables header getting a bit messed up as is demonstrated in this plunker:

http://plnkr.co/edit/96eAeq2F17gckRxydEFN?p=preview

In this particular example (and in the website I'm developing) we have css code that directly trims the size of the body like so:

@media (max-width: 800px) { body { /.../ max-width: 90%; /.../ }

In the datatables method _fnBrowserDetect() we have the following line:

    browser.bScrollbarLeft = test.offset().left !== 1;

Problem is when the body is trimmed, as in this example, the offset is something other than 1. For me it was something like 42.xx in my debugging. I've made the following alteration in my code which fixed it for me for most browsers, but I imagine it has to pass a more rigorous set of tests to make it into DT anyways:

    if (test.parent()) {
        browser.bScrollbarLeft = test.parent().offset() / test.offset().left > 1;
    } else {
        browser.bScrollbarLeft = test.offset().left !== 1;
    }

Let me know your thoughts...

-Keith


Viewing all articles
Browse latest Browse all 82581

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>