{hero}

columns().init()

Since: DataTables 2.0

Get the initialisation options for the selected columns.

Description

Please see the column().init() method for discussion of this method. It is identical and the same rules apply, with the exception of the fact that multiple columns can be selected and the returned value will always be a DataTables API object.

Type

function columns().init()

Description:

Get the initialisation options used for the select columns..

Returns:

API instance with the result set being the configuration objects from the selected columns.

Example

Get a property from all columns:

let table = new DataTable('#myTable', {
	columnDefs: [
		{
			target: 1,
			customProp: true
		}
	]
});

table.columns().every(function () {
	this.init().customProp;
	// is `true` for column index 1, otherwise undefined
});

Related

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