row().scrollTo()
Scroll to a specific row.
Please note - this property requires the Scroller extension for DataTables.
Description
This method can be used to jump to a specific row in the DataTable. The row is selected using the row() method, so all of the options available for the DataTable.RowSelector data type are available.
Please note that it is not always possible to select all rows in the table using the row() selector method - specifically when server-side processing is enabled, only the rows that are loaded into the client-side can be selected. If you need to jump to a specific display index, use the scroller.toPosition() method.
Type
row().scrollTo( animate )
Redraw the table's scrolling display to show the row selected by the row() method.
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | animate | Yes - default:true | |
Animate the scroll ( | |||
Returns:
DataTable.Api: DataTables API instance for chaining
Examples
Animated scroll to row index 100:
table.row(100).scrollTo();Immediate draw at row index 0:
table.row(0).scrollTo(false);Related
The following options are directly related and may also be useful in your application development.