This example shows a trivial use of the API methods that Scroller adds to the DataTables API to scroll to a row once the table's data has been loaded. In this
case row().scrollTo()
is used to jump to row
index 1000.
The Javascript shown below is used to initialise the table shown in this example:
1 2 3 4 5 6 7 8 9 10 11 12 | $(document).ready( function () { $( '#example' ).DataTable( { ajax: "../data/2500.txt" , deferRender: true , scrollY: 200, scrollCollapse: true , scroller: true , initComplete: function () { this .api().row( 1000 ).scrollTo(); } } ); } ); |
In addition to the above code, the following Javascript library files are loaded for use in this example: