DataTables buttons extension with colvis and bootstrap styling will not close [jQuery 3.1.0]

DataTables buttons extension with colvis and bootstrap styling will not close [jQuery 3.1.0]

drewDTdrewDT Posts: 2Questions: 1Answers: 0
edited September 2016 in Free community support

After updating to jQuery 3.1.0 using the DataTables Buttons extension to use ColVis with Bootstrap styling results in the following error

TypeError: $(...).parents(...).andSelf is not a function

After downgrading to jQuery 2.2.4 this error no longer appears in the console and the col visibility closes when the button is clicked.

TypeScript code

               initComplete: function () {
                    const api = this.api();

                    const button = new $.fn.dataTable.Buttons(api,
                    {
                        buttons: ["colvis"]
                    });

                    api.buttons().container().appendTo(`#datatable_wrapper .col-sm-6:eq(0)`);
                }

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,063Questions: 1Answers: 10,173 Site admin

    Hi,

    What version of Buttons are you using? This issue should have been resolved with the 1.2.2 (current) release by this commit.

    Allan

  • drewDTdrewDT Posts: 2Questions: 1Answers: 0

    I'm using the version that comes with the nuget package of jquery.DataTables 1.10.12. Which looks like it is 1.2.0.

  • allanallan Posts: 62,063Questions: 1Answers: 10,173 Site admin
    Answer ✓

    I'm afraid you would need to contact the maintainer of the NuGet packages if you can't use the latest version from this site. The NuGet packages are not maintained by myself (although it is one of the things on my to do list to create such packages).

    Allan

This discussion has been closed.