{hero}

language.searchBuilder.title

Since: SearchBuilder 1.0.0

Set the SearchBuilder Title text.
Please note - this property requires the SearchBuilder extension for DataTables.

Description

Searchbuilder can show summary information about the number of filters currently being implemented in the title field, providing quick and useful information to the end user.

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.

Note that as of 1.1.0 this language option is written to the document as HTML, therefore if you are using user input data you must sanitise it first.

Types

string

Description:

The language string to be displayed without any pluralisation considerations. The string can contain %d which will be replaced with the number of filters 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 filters 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 filters selected.

Default

  • Value: {0: 'Search Builder', _: 'Search Builder (%d)'}

Examples

Change message for SearchBuilder Title within a button:

new DataTable('#myTable', {
	language: {
		searchBuilder: {
			title: 'Search Builder Title'
		}
	},
	layout: {
		topStart: {
			buttons: ['searchBuilder']
		}
	}
});

Include counts in the title:

new DataTable('#myTable', {
	language: {
		searchBuilder: {
			title: {
				0: 'Search Builder',
				_: 'Search Builder (%d)'
			}
		}
	},
	titles: ['SearchBuilder'],
	layout: {
		top1: 'searchBuilder'
	}
});

Related

The following options are directly related and may also be useful in your application development.