1 |
// DATA_TEMPLATE: empty_table |
2 |
oTest.fnStart( "oLanguage.oPaginate" ); |
3 |
|
4 |
/* Note that the paging language information only has relevence in full numbers */ |
5 |
|
6 |
$(document).ready( function () { |
7 |
/* Check the default */ |
8 |
var oTable = $('#example').dataTable( { |
9 |
"bServerSide": true, |
10 |
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", |
11 |
"sPaginationType": "full_numbers" |
12 |
} ); |
13 |
var oSettings = oTable.fnSettings(); |
14 |
|
15 |
oTest.fnWaitTest( |
16 |
"oLanguage.oPaginate defaults", |
17 |
null, |
18 |
function () { |
19 |
var bReturn = |
20 |
oSettings.oLanguage.oPaginate.sFirst == "First" && |
21 |
oSettings.oLanguage.oPaginate.sPrevious == "Previous" && |
22 |
oSettings.oLanguage.oPaginate.sNext == "Next" && |
23 |
oSettings.oLanguage.oPaginate.sLast == "Last"; |
24 |
return bReturn; |
25 |
} |
26 |
); |
27 |
|
28 |
oTest.fnTest( |
29 |
"oLanguage.oPaginate defaults are in the DOM", |
30 |
null, |
31 |
function () { |
32 |
var bReturn = |
33 |
$('#example_paginate .first').html() == "First" && |
34 |
$('#example_paginate .previous').html() == "Previous" && |
35 |
$('#example_paginate .next').html() == "Next" && |
36 |
$('#example_paginate .last').html() == "Last"; |
37 |
return bReturn; |
38 |
} |
39 |
); |
40 |
|
41 |
|
42 |
oTest.fnWaitTest( |
43 |
"oLanguage.oPaginate can be defined", |
44 |
function () { |
45 |
oSession.fnRestore(); |
46 |
oTable = $('#example').dataTable( { |
47 |
"bServerSide": true, |
48 |
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", |
49 |
"sPaginationType": "full_numbers", |
50 |
"oLanguage": { |
51 |
"oPaginate": { |
52 |
"sFirst": "unit1", |
53 |
"sPrevious": "test2", |
54 |
"sNext": "unit3", |
55 |
"sLast": "test4" |
56 |
} |
57 |
} |
58 |
} ); |
59 |
oSettings = oTable.fnSettings(); |
60 |
}, |
61 |
function () { |
62 |
var bReturn = |
63 |
oSettings.oLanguage.oPaginate.sFirst == "unit1" && |
64 |
oSettings.oLanguage.oPaginate.sPrevious == "test2" && |
65 |
oSettings.oLanguage.oPaginate.sNext == "unit3" && |
66 |
oSettings.oLanguage.oPaginate.sLast == "test4"; |
67 |
return bReturn; |
68 |
} |
69 |
); |
70 |
|
71 |
oTest.fnTest( |
72 |
"oLanguage.oPaginate definitions are in the DOM", |
73 |
null, |
74 |
function () { |
75 |
var bReturn = |
76 |
$('#example_paginate .first').html() == "unit1" && |
77 |
$('#example_paginate .previous').html() == "test2" && |
78 |
$('#example_paginate .next').html() == "unit3" && |
79 |
$('#example_paginate .last').html() == "test4"; |
80 |
return bReturn; |
81 |
} |
82 |
); |
83 |
|
84 |
|
85 |
oTest.fnComplete(); |
86 |
} ); |