{hero}

select

Since: Select 1.0.0

Select configuration object.
Please note - this property requires the Select extension for DataTables.

Description

This option can be used to configure the Select extension for DataTables during the initialisation of a DataTable.

When Select has been loaded on a page, all DataTables on that page have the ability to have items selected, but by default this can only be done through the API - i.e. the end user will have no ability to select items in a table by default. To enable end user selection, this option should be used (the select.style() method can also be used after initialisation).

Exactly what selection the user can make, and how, depends upon the options selected.

Types

boolean

Description:

Enable user selection of rows using the OS style of selection (i.e. similar to a file list in an operating system which provides click options with cmd/ctrl and shift modifier key options. See select.style and select.items.

string

Description:

Enable user selection of rows using a style of selection defined by the string. See select.style for the options available.

object

Description:

Fine grained initialisation control of Select allowing full configuration of the selection options. Please refer to the initialisation options for full details.

Examples

Enable selection of rows in the OS style:

new DataTable('#myTable', {
	select: true
});

Enable selection of a single row:

new DataTable('#myTable', {
	select: 'single'
});

Disable selection summary information from being shown in the table information element.:

new DataTable('#myTable', {
	select: {
		info: false
	}
});

Select cells with no summary information shown:

new DataTable('#myTable', {
	select: {
		items: 'cell',
		info: false
	}
});