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