Using 'colvis' button to hide/display columns -- the columns list shows off the screen.

Using 'colvis' button to hide/display columns -- the columns list shows off the screen.

lisarushlisarush Posts: 30Questions: 6Answers: 0

Link to test case: http://live.datatables.net/nisileqa/12/edit (even if change Buttons version to 1.6.3) May need to narrow screen so 'Column Visibility' button is at far right.
Description of problem:

I have the 'colvis' button displayed at the far right of the table header. When I click on the button to get the list of columns to toggle, the list of columns aligns with the left side of the 'colvis' button & therefore, shows off the screen. If the CSS 'left' property is cleared, the columns list nicely aligns with the side of the screen. Best way to fix this?

I am upgrading from dataTables 1.10.16 to 1.10.21. I originally had this same problem with 1.10.16 here:
https://datatables.net/forums/discussion/comment/128399/#Comment_128399
with a fix provided here: https://github.com/DataTables/Buttons/commit/14d5f634cdcb41db7282f7fab3460a7e0bd31c23

With upgrading, I am seeing the problem again. Per this discussion, it looks like maybe someone else had this problem as well: https://datatables.net/forums/discussion/comment/172496/#Comment_172496
The live example mentioned that would fix it: http://live.datatables.net/nisileqa/1/edit seems to still have the problem?

Answers

  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    It looks like you're not using the nightly CSS in that example, you would need to use that too.

    Colin

  • lisarushlisarush Posts: 30Questions: 6Answers: 0

    Well, I did not actually create that test case. It was referenced from one of your developers as an example of it being fixed...

  • lisarushlisarush Posts: 30Questions: 6Answers: 0

    I have fixed this for my case by adding the following to our extension:

     opts.buttons.push( { extend: 'colvis',
               ...
               collectionLayout: 'dt-button-right' // added this line
     } );
    
  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    Thanks for posting back.

    Colin

Sign In or Register to comment.