Bug: button collection doesn't work

Bug: button collection doesn't work

svierkantsvierkant Posts: 27Questions: 1Answers: 0
edited May 2019 in Free community support

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

Answers

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Thank you. We've got a bug report filed for that internally and will get it done for the next Buttons release.

    Allan

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    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

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    Thanks!

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Hi,

    This should now be address by this commit. Colin will confirm once he has done his testing magic.

    Allan

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Yep, all good, will be in the pending release.

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0
    edited August 2019

    Thanks!
    Any idea when this will be released? I don't expect a date, but a rough estimation would be fine.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442
    Answer ✓

    Hopefully this month, if it's delayed, it will be in 2-3 weeks - so fairly soon!

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    Any update on this? It has been a very long time since the last release.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Hi @svierkant ,

    We're aiming on updating the CDN today, so the releases should follow next week.

    Cheers,

    Colin

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    The new release has a div around the <li> element, but inside the <ul> element:

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    Updated example with 1.6.0: https://jsfiddle.net/svierkant/61489vtr/

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    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

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    Fixed here and will be in the nightly soon.

    Allan

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    Any idea when it will be published in a stable version?

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0
    edited October 2019

    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:

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0
    edited October 2019

    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):

    import 'datatables.net-buttons'
    import 'datatables.net-buttons-bs/js/buttons.bootstrap'
    

    However, this:

    import './dataTables.buttons' //nightly
    import './buttons.bootstrap'  //nightly
    

    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?

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    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

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0
    edited October 2019

    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

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    I found it!

    Both buttons.colVis and buttons.bootstrap require datatables.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?

  • allanallan Posts: 51,736Questions: 1Answers: 7,825 Site admin

    I'm not actually clear yet what the fix is.

    Here datatables.net-buttons is already required.

    Allan

  • svierkantsvierkant Posts: 27Questions: 1Answers: 0

    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.

  • plamba95plamba95 Posts: 3Questions: 0Answers: 0

    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/

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    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

  • plamba95plamba95 Posts: 3Questions: 0Answers: 0

    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.

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    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

  • colincolin Posts: 8,619Questions: 0Answers: 1,442

    Not sure what happened there - here is it again: https://jsfiddle.net/colin0117/xwpbgjy8/2/

  • plamba95plamba95 Posts: 3Questions: 0Answers: 0

    Alright, that worked! Thank you!

Sign In or Register to comment.