{hero}

columns().dataSrc()

Since: DataTables 1.10.3

Get the data source property for the selected columns.

Description

DataTables has the ability to read data from a variety of complex data sources through use of the columns.data option. This method provides the ability to retrieve that setting for multiple columns after initialisation based on a column selector (see column-selector).

The value of columns.data that was set during initialisation (including the default of a column index integer) will be returned by this method, including functions (unevaluated). It is important to note that how columns.render is set has no effect on the return value of this method, which is used only for retrieving the value of columns.data.

Generally the singular representation of this method, column().dataSrc(), is likely to be more useful for authors. This method is included for completeness in the API.

Type

function columns().dataSrc()

Description:

Get the data source property for the selected columns

Returns:

API instance with the result set containing the data source parameters for the selected columns as configured by columns.data

Example

Get the data source for columns 0 and 1:

var table = new DataTable('#myTable');

alert(
	'Data source: ' +
		table
			.columns([0, 1])
			.dataSrc()
			.join(' ')
);

Related

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