{hero}

searchPanes.panes.preSelect

Since: SearchPanes 1.0.0

Deprecated. Define any preSelections for the custom panes.
Please note - this property requires the SearchPanes extension for DataTables.

Deprecated

As of v2.0.0 this feature has been deprecated. This feature has not yet been scheduled for removal, but its use is discouraged and the alternatives discussed below should be used.

Description

This option is an alias to searchPanes.panes.preSelect, which should be preferred when using DataTables 2+. It can be used to configure SearchPanes regardless of how the panes are inserted into the document (layout or searchPanes).

Please refer to the documentation for searchPanes.panes.preSelect for full details of this option.

Type

Array

Description:

The searchPanes.panes.preSelect array allows custom options to be preSelected for Custom Panes. The array is to be populated with strings that match the searchPanes.panes.options.label string.

Default

  • Value: Undefined

The default value of searchPanes.panes.preSelect is undefined as by default there should be no preSelected options.

Example

PreSelect 'Over 50' custom pane option:

new DataTable('#myTable', {
	layout: {
		top1: 'searchPanes'
	},
	searchPanes: {
		panes: [
			{
				header: 'Age Range',
				options: [
					{
						label: 'Over 50',
						value: function (rowData, rowIdx) {
							return rowData[3] > 50;
						}
					},
					{
						label: 'Under 50',
						value: function (rowData, rowIdx) {
							return rowData[3] < 50;
						}
					}
				],
				preSelect: ['Over 50']
			}
		]
	}
});

Related

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