1 |
// DATA_TEMPLATE: empty_table |
2 |
oTest.fnStart( "bPaginate" ); |
3 |
|
4 |
$(document).ready( function () { |
5 |
/* Check the default */ |
6 |
$('#example').dataTable( { |
7 |
"bServerSide": true, |
8 |
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php" |
9 |
} ); |
10 |
|
11 |
oTest.fnWaitTest( |
12 |
"Pagiantion div exists by default", |
13 |
null, |
14 |
function () { return document.getElementById('example_paginate') != null; } |
15 |
); |
16 |
|
17 |
oTest.fnWaitTest( |
18 |
"Information div takes paging into account", |
19 |
null, |
20 |
function () { return document.getElementById('example_info').innerHTML == |
21 |
"Showing 1 to 10 of 57 entries"; } |
22 |
); |
23 |
|
24 |
/* Check can disable */ |
25 |
oTest.fnWaitTest( |
26 |
"Pagiantion can be disabled", |
27 |
function () { |
28 |
oSession.fnRestore(); |
29 |
$('#example').dataTable( { |
30 |
"bServerSide": true, |
31 |
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", |
32 |
"bPaginate": false |
33 |
} ); |
34 |
}, |
35 |
function () { return document.getElementById('example_paginate') == null; } |
36 |
); |
37 |
|
38 |
oTest.fnWaitTest( |
39 |
"Information div takes paging disabled into account", |
40 |
null, |
41 |
function () { return document.getElementById('example_info').innerHTML == |
42 |
"Showing 1 to 57 of 57 entries"; } |
43 |
); |
44 |
|
45 |
/* Enable makes no difference */ |
46 |
oTest.fnWaitTest( |
47 |
"Pagiantion enabled override", |
48 |
function () { |
49 |
oSession.fnRestore(); |
50 |
$('#example').dataTable( { |
51 |
"bServerSide": true, |
52 |
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", |
53 |
"bPaginate": true |
54 |
} ); |
55 |
}, |
56 |
function () { return document.getElementById('example_paginate') != null; } |
57 |
); |
58 |
|
59 |
|
60 |
|
61 |
oTest.fnComplete(); |
62 |
} ); |