Since: DataTables 1.10.3

Get the data source property for the selected columns.


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.


function columns().dataSrc()


Get the data source property for the selected columns


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


Get the data source for columns 0 and 1:

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

	'Data source: ' +
			.columns([0, 1])
			.join(' ')


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