{hero}

fixedColumns

Since: FixedColumns 3.1.0

Enable and configure the FixedColumns extension for DataTables.
Please note - this property requires the FixedColumns extension for DataTables.

Description

FixedColumns provides the option to freeze one or more columns at the start or end of a horizontally scrolling DataTable. This allows information in the fixed columns to remain visible even when scrolling through the data set. This can be particularly useful if you wish to show a large number of columns.

This option provides the ability to enable and configure FixedColumns for DataTables. In its simplest form as the boolean true it will enable FixedColumns with the default configuration options (as defined by DataTable.FixedColumns.defaults). It can also be used as an object to provide custom configuration options as described below.

Please note that as with all other configuration options for FixedColumns, this option is an extension to the default set of DataTables options. This property should be set in the DataTables initialisation object.

Types

boolean

Description:

As a boolean value this property will enable FixedColumns on the DataTable that is being created. true will enable FixedColumns, while false will not.

This is a short-cut option to enable FixedColumns with the default configuration options. Customisations can be made by giving this parameter as an object, see below.

object

Description:

If given as an object, FixedColumns will be enabled on the target DataTable, with default values (DataTable.FixedColumns.defaults) extended, and potentially overwritten, by the options provided in this object. This is how FixedColumns can be configured on an individual table basis, or through the defaults.

Default

  • Value: undefined

FixedColumns will not be initialised by default

Examples

Enable FixedColumns for a table:

new DataTable('#myTable', {
	fixedColumns: true
});

Enable FixedColumns with configuration options:

new DataTable('#myTable', {
	fixedColumns: {
		start: 2
	}
});