Problem with colvis dropdown menu

Problem with colvis dropdown menu

Tiago Azevedo BorgesTiago Azevedo Borges Posts: 11Questions: 2Answers: 0

The dropdown menu is without the property "data-toggle = 'dropdown'". This causes the menu to render incorrectly.
Is there a way to fix this?

Replies

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin

    Can you link to a test case showing the issue please?

    Allan

  • Tiago Azevedo BorgesTiago Azevedo Borges Posts: 11Questions: 2Answers: 0

    Take a look: https://jsfiddle.net/rro1dj5j/

    The colvis button does not have the data-toggle = "dropdown", so the div of the dropdown menu is not positioned correctly.

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin

    I'm still not clear on what the problem is I'm afraid. If I add data-toggle="dropdown" in the inspector, I just get an error about Popper.js not being included and the menu shows as it was.

    Allan

  • Tiago Azevedo BorgesTiago Azevedo Borges Posts: 11Questions: 2Answers: 0

    Would then have to calculate the left value so that the dropdown does not stay out of the window.

  • Tiago Azevedo BorgesTiago Azevedo Borges Posts: 11Questions: 2Answers: 0

    Something like

    var toBig = $($('.dt-button-collection')[0]).offset().left + $($('.dt-button-collection')[0]).width() > $(window).width()

  • JoyrexJoyrex Posts: 92Questions: 14Answers: 3

    The offset should be handled by the Popper.js library...

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin

    Actually Buttons doesn't use Popper, even when Bootstrap 4 and Popper is loaded. it does its own little positioning.

    However, I see and understand the issue now. This commit fixes it and the nightly will contain the fix shortly.

    Allan

  • Tiago Azevedo BorgesTiago Azevedo Borges Posts: 11Questions: 2Answers: 0

    Tank you Allan! I'll wait for the next version since I need to use nuget.

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin

    I'm afraid we don't publish Nuget packages (yet - it is planned!). There are third party package maintainers who do so though!

    Allan

  • Tiago Azevedo BorgesTiago Azevedo Borges Posts: 11Questions: 2Answers: 0

    I know, I asked one of the owners of one of the most downloaded packages to upgrade the version, they are still at 1.10.15. Now I have to wait.

  • lisarushlisarush Posts: 85Questions: 15Answers: 0

    I was having the same problem -- with the dropdown column list being displayed off the screen.
    The fix mentioned above is not quite correct. In the "if" clause, "listRight" should really be "listOffsetRight".

  • d052057d052057 Posts: 38Questions: 3Answers: 0

    There is issue with Editor dropdown as well. See my sample of code that the dropdown menu (nav) did not expand.

    Editor 1.7.3 and Editor 1.7.2 with Datatable 1.10.16.

    Thanks.

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin

    @d052057 - Can you link to a test case showing the issue please?

    Allan

This discussion has been closed.