{hero}

row().select()

Since: Select 1.0.0

Select a single row.
Please note - this property requires the Select extension for DataTables.

Description

This method simply selects a single row that has been found by the row() selector method.

If the selection style (select.style / select.style()) is set to single any previously selected rows will be automatically deselected. Otherwise the row will be added to the current selected set.

Selected rows can later be retrieved using the selected extension to the selector-modifier object - for example table.rows( { selected: true } ).data() will get the data of all rows which are selected in the table.

Type

function row().select()

Description:

Select a single row in the table, based on the row found by the row() method.

Returns:

API instance that contains a reference to the selected row.

Example

Select the first row in the table's current page:

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

table.row(':eq(0)', { page: 'current' }).select();

Related

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