{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

As standard, Custom panes have no preSelected options.

Setting searchPanes.panes.preSelect to contain strings that match the value of an options searchPanes.panes.options.label will allow SearchPanes to select that option for preSelection.

Note: Before version 2.0.0 where this option was deprecated, searchPanes.panes.preSelect was not supported with searchPanes.cascadePanes. This was because in order to have the cascade operate as expected the selections has to be made in the correct order. It is however now in versions after 2.0.0 using searchPanes.preSelect.

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: {
				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.