Scroller example Client-side data source (50,000 rows)

This example is completely artificial in that the data generated is created on the client-side by just looping around a Javascript array and then passing that to DataTables. However, it does show quite nicely that DataTables and Scroller can cope with large amounts of data on the client-side quite nicely. Typically data such as this would be Ajax sourced and server-side processing should be considered.

Please be aware that the performance of this page will depend on your browser as the array of data is generated - for example IE6 will crawl!

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
14
$(document).ready(function() {
        var data = [];
        for ( var i=0 ; i<50000 ; i++ ) {
            data.push( [ i, i, i, i, i ] );
        }
         
        var oTable = $('#example').dataTable( {
            data:           data,
            deferRender:    true,
            dom:            "frtiS",
            scrollY:        200,
            scrollCollapse: true
        } );
    } );

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