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 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 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

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


Get the data source for columns 0 and 1:

var table = $('#example').DataTable();

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


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