Buttons 3.0.0

DataTables CDN files for Buttons 3.0.0. This software was originally released on 15th February, 2024.

Release notes

This is a major update for Buttons which makes full use of the new complex headers and footers support from DataTables 2's APIs to make it possible to export multi-row headers and footers, and those with colspan and rowspan attributes as well! This is something we've all wanted for a while and it is now finally here!

There are a number of other tweaks, such as the export buttons being asynchronous to allow a processing indicator to show that something is happening when activated (needed for larger exports), and of course a range of fixes.

Buttons 3+ is not compatible with DataTables 1.x, it requires DataTables 2+ due to the use of the new APIs.

New

  • Requires DataTables 2+
  • Export buttons are all now asynchronous, meaning they happen in the background of the browser, after the user has click the button and shown a processing indicator. This makes it clearer to the end user that something is happening.
  • buttons.buttons.async option to specify async behaviour of a button
  • Print export includes support for multi-row headers and footers
  • Print export includes support for colspan / rowspan in headers and footers
  • Copy and CSV now support multi-row headers
  • Copy and CSV now support colspan / rowspan by using an empty string as filler.
  • Excel export supports multi-row header and footers now
  • Excel export supports colspan / rowspan in the header and footer
  • Support for multi-row and complex headers and footers in PDF export.
  • PDF page size will default to LETTER for US and Canadian locales
  • filename, messageTop, messageBottom and title configuration options for export buttons, when given as a function, are now passed the button's configuration object and a DataTables API instance as the two parameters for the function now.

Updates

  • orthogonal data for export is now an empty string - this tells DataTables to use the underlying data for example, not the formatted data, which might contain locale specific formatting.
  • Documentation removes mention of the fact that IE8/9 are not supported. This is now a core part of the DataTables support - no IE, so it doesn't need to be explicitly noted.
  • Footers are included in the Excel export by default
  • Footer is now included in the PDF export by default
  • Action function now receives a fifth parameter, a callback that must be executed when the action is complete if the async parameter for the button is set.

Fixes

  • Set default orthogonal data for export to be display
  • Disable row shading for print
  • Dropdown default width of 200px
  • Overflow should not result in ellipsis for split arrow button
  • Foundation styling for multi-column layout
  • FomanticUI with popoverTitle wasn't displaying well
  • Bulma popoverTitle wasn't showing correctly
  • Bootstrap 5 dropdown would expand forever
  • Bootstrap 4 styling for long button text and titles
  • Bootstrap 3 and popoverTitle weren't working together
  • Overflow styling for long buttons wasn't right in Bootstrap, Bulma, Foundation
  • jQuery UI dropdown would loose its dropdown arrow on text update due to no wrapping element
  • When columns were reordered, the name of a button wasn't being retained if it was specified as a string.
  • Column visibility restore (colvisRestore) was breaking when columns were reordered. They would restore to the state when the columns were reordered, rather than their original state.
  • format.body function was being passed loop counters rather than the row and column indexes as it should have been (per the docs).
  • spacer button was incorrectly positioned in Bootstrap 3
  • Left align $ for currency column in exported Excel file
  • Add typescript defs for jszip and pdfMake static methods

Types

  • Fix integration with DataTables ext object
  • new Buttons constructor returns an instance of Buttons
  • Button methods have their own trigger method

Docs

  • Update for Buttons as a "feature" in DataTables 2
  • Consistent formatting for example snippets

Examples

  • New example - Explain and show how CSS can be applied specifically for print view only
  • Updated for DataTables 2. Focus is on the layout option, rather than the legacy dom option
  • All examples now have a Vanilla JS variant
  • All examples formatted using prettier-more for consistent styling of the code.

Files