{hero}

searchPanes.order

Since: SearchPanes 1.1.0

Set the order of the Panes.
Please note - this property requires the SearchPanes extension for DataTables.

Description

By setting the searchPanes.order to an array of the columns.searchPanes.name property of the SearchPanes, the panes are displayed in that order.

By default the columns.searchPanes.name is set to be the title of the column. This can be overridden if desired. This is particularly useful for mixing custom and auto generated panes. If the searchPanes.order property is set then any panes that would normally have shown but are not present in the array will not be shown at all.

Type

string

Description:

By setting the searchPanes.order to an array of the columns.searchPanes.name property of the SearchPanes, the panes are displayed in that order.

By default the columns.searchPanes.name is set to be the title of the column, or the searchPanes.panes.header value for custom Panes. This can be overridden if desired.

Default

  • Value: []

The default value for the searchPanes.order parameter is an empty array allowing SearchPanes to use the default order..

Examples

Set the order of the panes:

new DataTable('#myTable', {
	layout: {
		top1: {
			searchPanes: {
				order: ['Age', 'Office', 'Position']
			}
		}
	}
});

Set the order of the panes including a custom name:

new DataTable('#myTable', {
	columnDefs: [
		{
			searchPanes: {
				name: 'Length of Life'
			},
			targets: [3]
		}
	],
	layout: {
		top1: {
			searchPanes: {
				order: ['Length of Life', 'Office', 'Position']
			}
		}
	}
});

Related

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