{hero}

collection

Since: Buttons 1.0.0

A button which triggers a drop down with another set of buttons.
Please note - this property requires the Buttons extension for DataTables.

Description

The collection button type is integral to Buttons as it provides the ability to show one or more "sub-buttons" in a drop down that is displayed when the button is activated. This provides a method of collecting like buttons and displaying them in a space efficient manner for the end user.

The key aspect of this button type is the buttons option, which is an array of the buttons that you want to show in the drop down. The buttons defined here are exactly the same as any other button and can also be accessed via the API and manipulated as such.

Options

This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text):

Example

DataTables initialisation: Create an export collection:

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: [
				{
					extend: 'collection',
					text: 'Export',
					buttons: ['csv', 'excel', 'pdf']
				}
			]
		}
	}
});