language.select.cells
Table information summary string for the number of cells selected.
Please note - this property requires the Select extension for DataTables.
Description
Select can show summary information about the number of cells 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 cells 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 cells 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 cells 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 cells selected.
Default
- Value:
Examples
A simple string with no concern for pluralisation:
new DataTable('#myTable', {
language: {
select: {
cells: '%d cells selected'
}
},
select: true
});
Show a message when no cells are selected:
new DataTable('#myTable', {
language: {
select: {
cells: {
_: 'Selected %d cells',
0: 'Click a cell to select it',
1: 'Selected 1 cell'
}
}
},
select: true
});