Scroller example API

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 scroller().scrollToRow() is used to jump to row 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
13
$(document).ready(function() {
    $('#example').DataTable( {
        ajax:        "data/2500.txt",
        deferRender: true,
        dom:         "frtiS",
        scrollY:     200,
        scrollCollapse: true,
        initComplete: function () {
            var api = this.api();
            api.scroller().scrollToRow( 1000 );
        }
    } );
} );

In addition to the above code, the following Javascript library files are loaded for use in this example: