1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "bInfiniteScroll" );
5 $(document).ready( function () {
6 var oTable = $('#example').dataTable( {
7 "bScrollInfinite": true,
10 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
16 function () { return $('#example tbody tr').length == 10; }
22 function () { return $('#example_info').html() == "Showing 1 to 10 of 57 entries"; }
28 function () { return $('#example tbody>tr').length == 10; }
34 function () { return $('#example').dataTable().fnGetNodes().length == 10; }
38 "Scroll on 20px adds 10 rows",
39 function () { $('div.dataTables_scrollBody').scrollTop(20); },
40 function () { return $('#example tbody tr').length == 20; }
44 "Info after 20px scroll",
46 function () { return $('#example_info').html() == "Showing 1 to 20 of 57 entries"; }
50 "Get nodes after 20px scroll",
52 function () { return $('#example tbody>tr').length == 20; }
56 "Get nodes function after 20px scroll",
58 function () { return $('#example').dataTable().fnGetNodes().length == 20; }
62 "Scroll on 10px more results in the same number of rows",
63 function () { $('div.dataTables_scrollBody').scrollTop(30); },
64 function () { return $('#example tbody tr').length == 20; }
68 "Info after 10 more px scroll",
70 function () { return $('#example_info').html() == "Showing 1 to 20 of 57 entries"; }
74 "Scroll to 280px adds another 10 rows",
75 function () { $('div.dataTables_scrollBody').scrollTop(280); },
76 function () { return $('#example tbody tr').length == 30; }
80 "Info after 240px scroll",
82 function () { return $('#example_info').html() == "Showing 1 to 30 of 57 entries"; }
86 "Get nodes after 240px scroll",
88 function () { return $('#example tbody>tr').length == 30; }
92 "Get nodes function after 240px scroll",
94 function () { return $('#example').dataTable().fnGetNodes().length == 30; }
98 "Filtering will drop back to 10 rows",
99 function () { oTable.fnFilter('gec') },
100 function () { return $('#example tbody tr').length == 10; }
104 "Info after filtering",
106 function () { return $('#example_info').html() == "Showing 1 to 10 of 20 entries (filtered from 57 total entries)"; }
110 "Get nodes after filtering",
112 function () { return $('#example tbody>tr').length == 10; }
116 "Get nodes function after filtering",
118 function () { return $('#example').dataTable().fnGetNodes().length == 10; }
122 "Scroll after filtering adds 10",
123 function () { $('div.dataTables_scrollBody').scrollTop(20); },
124 function () { return $('#example tbody tr').length == 20; }
128 "Get nodes after filtering",
130 function () { return $('#example tbody>tr').length == 20; }
134 "Get nodes function after filtering",
136 function () { return $('#example').dataTable().fnGetNodes().length == 20; }
140 "Sorting will drop back to 10 rows",
142 $('div.dataTables_scrollBody').scrollTop(0);
143 oTable.fnSort([[1,'asc']])
145 function () { return $('#example tbody tr').length == 10; }
149 "Scroll after sorting adds 10",
150 function () { $('div.dataTables_scrollBody').scrollTop(20); },
151 function () { return $('#example tbody tr').length == 20; }
155 "Get nodes after scrolling",
157 function () { return $('#example tbody>tr').length == 20; }
161 "Get nodes function after scrolling",
163 function () { return $('#example').dataTable().fnGetNodes().length == 20; }