Bug: button collection doesn't work

Bug: button collection doesn't work

svierkantsvierkant Posts: 26Questions: 1Answers: 0
edited May 7 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: 50,506Questions: 1Answers: 7,508 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: 6,206Questions: 0Answers: 1,066

    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: 26Questions: 1Answers: 0

    Thanks!

  • allanallan Posts: 50,506Questions: 1Answers: 7,508 Site admin

    Hi,

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

    Allan

  • colincolin Posts: 6,206Questions: 0Answers: 1,066

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

  • svierkantsvierkant Posts: 26Questions: 1Answers: 0
    edited August 22

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

  • colincolin Posts: 6,206Questions: 0Answers: 1,066
    Answer ✓

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

  • svierkantsvierkant Posts: 26Questions: 1Answers: 0

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

  • colincolin Posts: 6,206Questions: 0Answers: 1,066

    Hi @svierkant ,

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

    Cheers,

    Colin

  • svierkantsvierkant Posts: 26Questions: 1Answers: 0

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

  • svierkantsvierkant Posts: 26Questions: 1Answers: 0

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

  • allanallan Posts: 50,506Questions: 1Answers: 7,508 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: 50,506Questions: 1Answers: 7,508 Site admin

    Fixed here and will be in the nightly soon.

    Allan

  • svierkantsvierkant Posts: 26Questions: 1Answers: 0

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

  • svierkantsvierkant Posts: 26Questions: 1Answers: 0
    edited October 7

    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: 26Questions: 1Answers: 0
    edited October 8

    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: 50,506Questions: 1Answers: 7,508 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: 26Questions: 1Answers: 0
    edited October 10

    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: 26Questions: 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: 50,506Questions: 1Answers: 7,508 Site admin

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

    Here datatables.net-buttons is already required.

    Allan

  • svierkantsvierkant Posts: 26Questions: 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.

Sign In or Register to comment.