{hero}

language.select.columns

Since: Select 1.0.0

Table information summary string for the number of columns selected.
Please note - this property requires the Select extension for DataTables.

Description

Select can show summary information about the number of columns selected in the table in the table's information element (info). This can provide quick and useful information to the end user to show the table's current state - see select.info.

This language option can be used to provide information to the end user about the number of columns that are selected.

Internally the DataTables' i18n() method is used to determine the string value to display, which can provide complex singular, plural, dual, etc language strings for true multi-language support. Please refer to the object section below for details.

Types

string

Description:

The language string to be displayed without any pluralisation considerations. The string should contain %d which will be replaced with the number of columns selected.

object

Description:

As an object this option can be used to define different strings to use for the various singular, plural, dual, etc options required by many languages. If the number of columns selected matches a parameter name in the object, the value of that parameter will be used. If there is no match the _ (which must be defined) is used as the default.

As with the string case above, any of the parameter values defined in this object can contain the string %d which will be replaced with the number of columns selected.

Default

  • Value:

Examples

A simple string with no concern for pluralisation:

new DataTable('#myTable', {
	language: {
		select: {
			columns: '%d columns selected'
		}
	},
	select: true
});

Show a message when no columns are selected:

new DataTable('#myTable', {
	language: {
		select: {
			columns: {
				_: 'Selected %d columns',
				0: 'Click a column to select it',
				1: 'Selected 1 column'
			}
		}
	},
	select: true
});