{hero}

searchBuilder.columns

Since: SearchBuilder 1.0.0

Restrict which columns can be filtered on.
Please note - this property requires the SearchBuilder extension for DataTables.

Description

This is useful as it allows restrictions to be made on which data points can be filtered on. For tables with a large amount of columns, this prevents having a large set of options within the select element.

Type

column-selector

Description:

number[] of the columns that can be filtered. This accepts all of the options of column-selector such as class name selector, jQuery pseudo selects and column index selectors.

Default

  • Value: true

The default value for this option is true meaning that as standard all of columns can be filtered on.

Example

Allow three columns to be filtered on:

new DataTable('#myTable', {
	layout: {
		top1: {
			searchBuilder: {
				columns: [1, 2, 3]
			}
		}
	}
});