annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/bPaginate.js @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "bPaginate" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 "Pagiantion div exists by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 function () { return document.getElementById('example_paginate') != null; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 "Information div takes paging into account",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 /* Check can disable */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 "Pagiantion can be disabled",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 "bPaginate": false
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 function () { return document.getElementById('example_paginate') == null; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 "Information div takes paging disabled into account",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 "Showing 1 to 57 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 /* Enable makes no difference */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 "Pagiantion enabled override",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 "bPaginate": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 function () { return document.getElementById('example_paginate') != null; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 } );