{hero}

language.select.rows

Since: Select 1.0.0

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

Description

Select can show summary information about the number of rows 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 rows 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 rows 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 rows 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 rows selected.

Default

  • Value:

Examples

A simple string with no concern for pluralisation:

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

Show a message when no rows are selected:

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