Problem with colvis dropdown menu
Problem with colvis dropdown menu
Tiago 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?
This discussion has been closed.
Replies
Can you link to a test case showing the issue please?
Allan
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.
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
Would then have to calculate the left value so that the dropdown does not stay out of the window.
Something like
var toBig = $($('.dt-button-collection')[0]).offset().left + $($('.dt-button-collection')[0]).width() > $(window).width()
The offset should be handled by the Popper.js library...
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
Tank you Allan! I'll wait for the next version since I need to use nuget.
I'm afraid we don't publish Nuget packages (yet - it is planned!). There are third party package maintainers who do so though!
Allan
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.
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".
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.
@d052057 - Can you link to a test case showing the issue please?
Allan