Bug: button collection doesn't work
Bug: button collection doesn't work

I've used the latest version of Datatables, Bootstrap 3 and Buttons/ColVis based on this example: https://datatables.net/extensions/buttons/examples/initialisation/collections-sub.html
Problem started with Buttons 1.5.5
https://jsfiddle.net/svierkant/1830uacx/1/ (latest version, doesn't work)
https://jsfiddle.net/svierkant/1830uacx/3/ (Buttons 1.5.4, does work)
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Thank you. We've got a bug report filed for that internally and will get it done for the next Buttons release.
Allan
Hi @svierkant ,
I've raised it internally (DD-889 for my reference) and we'll report back here when there's an update.
Cheers,
Colin
Thanks!
Hi,
This should now be address by this commit. Colin will confirm once he has done his testing magic.
Allan
Yep, all good, will be in the pending release.
Thanks!
Any idea when this will be released? I don't expect a date, but a rough estimation would be fine.
Hopefully this month, if it's delayed, it will be in 2-3 weeks - so fairly soon!
Any update on this? It has been a very long time since the last release.
Hi @svierkant ,
We're aiming on updating the CDN today, so the releases should follow next week.
Cheers,
Colin
The new release has a div around the
<li>
element, but inside the<ul>
element:Updated example with 1.6.0: https://jsfiddle.net/svierkant/61489vtr/
Apologies - we missed that. I've seen your comment about this in Github as well.
I'll post back shortly when I'd added a fix.
Allan
Fixed here and will be in the nightly soon.
Allan
Any idea when it will be published in a stable version?
I've tried the nightly and it doesn't work as expected.
Before:


After:
(multilevel options (such as length) don't work at all)
<button> elements are used, while the previous version used <li> elements:
I'm sorry, I'm not a Javascript expert. But I'll try to explain what's going wrong. A 'standalone' (JSFiddle) example works, but I'm using Webpack. In 1.5.4 and 1.6.0 this works (with bugs, but at least they work in some way):
However, this:
Leads to example above (no styling, multilevel buttons don't work). So, for some reason, the defaults in buttons.bootstrap.js won't be applied. Any idea?
I'd really need full steps on how to reproduce this, particularly given that you note that it works in JSFiddle. It sounds like you might not that the
./dataTables.buttons.js
file present in the directory that that file is being compiled in.To create a test case you could create a sample project on github (or similar) and let me know what the git address is and also the steps to compile.
Allan
I can see the file is included in the compiled file, but the defaults aren't applied to the buttons. I'll try to create a test case.
When I change the order of both scripts, I get this error message when I click on a collection button:
Uncaught TypeError: set.inst._popover is not a function
I found it!
Both
buttons.colVis
andbuttons.bootstrap
requiredatatables.net-buttons
, so Webpack adds the stable (1.6.0) version from node_modules in my compiled file. I've manually changed the files and now it works!Any idea when this fix will be released?
I'm not actually clear yet what the fix is.
Here
datatables.net-buttons
is already required.Allan
No fix needed; a tagged release would help
. The problem is that including a nightly build in my project didn't work out as expected.
I've included the nightly build, but since the scripts (i.e. colvis) require datables.net-buttons, Webpack included the stable version (from npm). I've copied the nightly versions to my project, removed the datatables.net-buttons requirement and now it works.
Hey, I have been following the topic and I just noticed that buttons v1.6.1 is out. But the collection is still broken for me. See here https://jsfiddle.net/7npgu45y/
Hi @plamba95 ,
That appears to be working for me. Can you give more details on why you think it's wrong and how to reproduce, please.
Cheers,
Colin
Hey @colin
Something went wrong when saving the jsfiddle. Here is the correct URL https://jsfiddle.net/fkwyrv5j/3/ The problem comes with using bootstrap 3.3.7, datatables 1.10.20 and buttons 1.6.1 incl. bootstrap3 for them. The bug is that the
<
ul> is not showing.
Hi @plamba95 ,
I think the problem was with the ordering of your libraries. I've changed them here, and it seems to be behaving,
Cheers,
Colin
Not sure what happened there - here is it again: https://jsfiddle.net/colin0117/xwpbgjy8/2/
Alright, that worked! Thank you!