scroller.toPosition()
Scroll to a specific row display index.
Please note - this property requires the Scroller extension for DataTables.
Description
This method can be used to move the scrolling position to a given row in the current display order. If you know the row you wish to scroll to, use the row().scrollTo()
method - this method is useful for cases where you don't know what row is in the position you wish to scroll to!
Type
scroller.toPosition( index [, animate ] )
Move the display to show the row at the index given.
Parameters:
Name | Type | Optional | |
---|---|---|---|
1 | index | No | |
Display index to jump to. | |||
2 | animate | Yes - default:true | |
Animate the scroll ( |
Returns:
DataTables.Api
DataTables API instance for chaining
Example
Animated scroll to display index 100:
table.scroller.toPosition(100);
Related
The following options are directly related and may also be useful in your application development.