COLVIS - columns extending beyond table

COLVIS - columns extending beyond table

DB10DB10 Posts: 7Questions: 1Answers: 0

Hi,

I know I should have an example ready for this but am hoping this will ring a bell for someone that recognizes the issue and also recalls the solution (I swear I've fixed this once but can't remember what the fix was).

Using bootstrap 3.3.7 and responsive 2.2.2 , and I think that might have been the issue, with datatables 1.10.16.

Whilst the table renders fine with the default columns selected, when I use colvis to make additional columns visible, at some stage columns will start appearing outside of the table (to the right) and without a column header. Those same columns do also, correctly, appear and can be made visible by clicking the leftmost icon that's used to show content that doesn't fit on the screen.

I know that description doesn't make the most sense so, trying to word it differently.

The table renders correctly when it loads. When adding columns using colvis, in addition to displaying in the "responsive" section, they also appears on the "parent" row outside of the rightmost element of the table.

I thought the solution was to separately download and grab a different version of either the responsive or bootstrap file but I can't seem to find the forum post that suggested this as a solution (and that I thought was working and that I've since, obviously, overwritten).

Thank you for your kind help

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @DB10 ,

    Sorry, that doesn't ring any bells, and I've searched the forum/SO and nothing is popping up. I think it really needs that example or a link to your page, I'm afraid.

    Cheers,

    Colin

  • allanallan Posts: 63,457Questions: 1Answers: 10,465 Site admin
    Answer ✓

    In the switch from DataTables 1.10.16 to 1.10.17/18 there was a change in the Bootstrap 4 integration which could cause this effect. But I don't think there was any change in the Bootstrap 3 integration.

    The issue was basically that I removed the container class from the DataTables default styling for Bootstrap4 (it should be controlled by a higher up DOM element).

    So I think in this case since it is BS3, we'd need a link to a page showing the issue.

    Thanks,
    Allan

  • DB10DB10 Posts: 7Questions: 1Answers: 0

    Thanks Colin and Allan for your replies, much appreciated.

    I might have the versions wrong, I'll have to check when I get in. Because this only seems to happen with the columns that have visibility set to false, and those are only really used for filtering data, I'm thinking of using classname to "permanently" hide them and that way avoid this issue. That's probably being a bit lazy but might end up being the quicker fix. If you don't mind, I'll probably leave this open a few days in case that too fails and I need to setup an example and hope for more of your kind help.

    Thanks heaps

This discussion has been closed.