@mlink/datatables.net-scroller
Version:
Virtual scrolling plug-in for DataTables
34 lines (24 loc) • 1.64 kB
text/xml
<dt-example table-type="scroller" table-class="display nowrap" order="1">
<css lib="datatables scroller" />
<js lib="jquery datatables scroller">
<![CDATA[
$(document).ready(function() {
$('#example').DataTable( {
ajax: "../data/2500.txt",
deferRender: true,
scrollY: 200,
scrollCollapse: true,
scroller: true
} );
} );
]]>
</js>
<title lib="Scroller">Basic initialisation</title>
<info><, or add `th, td { white-space: nowrap; }` to your CSS, to ensure that text in rows does not wrap.
This example shows how Scroller for DataTables can be initialised, when the Scroller Javascript file is included, by simply setting the `s-init scroller` option to `true`. This option can also be given as an object to specify initialisation options for Scroller.
Deferred rendering (`dt-init deferRender`) should be used when Scroller is enabled to gain the speed benefits offered by Scroller. The data source for this example is an Ajax file (`dt-init ajax`).
]]></info>
</dt-example>