{hero}

searchBuilder.logic

Since: SearchBuilder 1.0.0

Set the default logic operator.
Please note - this property requires the SearchBuilder extension for DataTables.

Description

This option allows for the default logic of all groups to be set when they are initialised. This can take the value of either AND or OR. As default AND logic is used because it is the most predominant form to use when searching a dataset.

When using searchBuilder.preDefined searches, this value is also used if the logic parameter is not defined in the initialisation.

Type

string

Description:

The value for the default logic operator for groups, either AND or OR.

Default

  • Value: AND

The default value for this option is AND meaning that as standard the initial logic applied to groups will be AND logic.

Example

Setting the default logic to 'OR':

new DataTable('#myTable', {
	layout: {
		top1: {
			searchBuilder: {
				logic: 'OR'
			}
		}
	}
});