{hero}

language.searchBuilder.button

Since: SearchBuilder 1.0.0

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

Description

As standard, SearchBuilder will set the SearchBuilder Button to display a default text, in this case {0: 'Search Builder', _: 'Search Builder (%d)'}. where %d is the total number of criteria that are active.

The value of language.searchBuilder.button is passed into an i18n() function. %d is replaced by the number of criteria that are in place. To just set the Button text to be a string no matter the count, just set language.searchBuilder.button to be the desired string.

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 button which also displays criteria count::

new DataTable('#myTable', {
	language: {
		searchBuilder: {
			button: {
				0: 'Criteria',
				1: 'Criteria (one selected)',
				_: 'Criteria (%d)'
			}
		}
	},
	layout: {
		top1: {
			buttons: ['searchBuilder']
		}
	}
});

Change message for SearchBuilder button:

new DataTable('#myTable', {
	buttons: ['searchBuilder'],
	language: {
		searchBuilder: {
			button: 'searchBuilder'
		}
	},
	layout: {
		top1: {
			buttons: ['searchBuilder']
		}
	}
});

Related

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