1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="columns">
<name>columns().dataSrc()</name>
<summary>Get the data source property for the selected columns.</summary>
<since>1.10.3</since>
<type type="function">
<signature>columns().dataSrc()</signature>
<description>Get the data source property for the selected columns</description>
<returns type="DataTables.Api">API instance with the result set containing the data source parameters for the selected columns as configured by `dt-init columns.data`</returns>
</type>
<description>
DataTables has the ability to read data from a variety of complex data sources through use of the `dt-init columns.data` option. This method provides the ability to retrieve that setting for multiple columns after initialisation based on a column selector (see `dt-type column-selector`).
The value of `dt-init 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 `dt-init columns.render` is set has no effect on the return value of this method, which is used only for retrieving the value of `dt-init columns.data`.
Generally the singular representation of this method, `dt-api column().dataSrc()`, is likely to be more useful for authors. This method is included for completeness in the API.
</description>
<example title="Get the data source for columns 0 and 1"><![CDATA[
var table = $('#example').DataTable();
alert( 'Data source: '+table.columns( [0, 1] ).dataSrc().join(' ') );
]]></example>
<related type="api">columns().data()</related>
<related type="api">column().data()</related>
<related type="api">column().dataSrc()</related>
</dt-api>
|