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