1 |
// DATA_TEMPLATE: empty_table |
2 |
oTest.fnStart( "oLanguage.sLoadingRecords" ); |
3 |
|
4 |
$(document).ready( function () { |
5 |
var tmp = false; |
6 |
oTest.fnTest( |
7 |
"Default loading text is 'Loading...'", |
8 |
function () { |
9 |
$('#example').dataTable( { |
10 |
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt" |
11 |
} ); |
12 |
tmp = $('#example tbody tr td')[0].innerHTML == "Loading..."; |
13 |
}, |
14 |
function () { return tmp; } |
15 |
); |
16 |
|
17 |
oTest.fnTest( |
18 |
"Text can be overriden", |
19 |
function () { |
20 |
oSession.fnRestore(); |
21 |
$('#example').dataTable( { |
22 |
"oLanguage": { |
23 |
"sLoadingRecords": "unitest" |
24 |
}, |
25 |
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt" |
26 |
} ); |
27 |
tmp = $('#example tbody tr td')[0].innerHTML == "unitest"; |
28 |
}, |
29 |
function () { return tmp; } |
30 |
); |
31 |
|
32 |
oTest.fnTest( |
33 |
"When sZeroRecords is given but sLoadingRecords is not, sZeroRecords is used", |
34 |
function () { |
35 |
oSession.fnRestore(); |
36 |
$('#example').dataTable( { |
37 |
"oLanguage": { |
38 |
"sZeroRecords": "unitest_sZeroRecords" |
39 |
}, |
40 |
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt" |
41 |
} ); |
42 |
tmp = $('#example tbody tr td')[0].innerHTML == "unitest_sZeroRecords"; |
43 |
}, |
44 |
function () { return tmp; } |
45 |
); |
46 |
|
47 |
oTest.fnTest( |
48 |
"sLoadingRecords and sZeroRecords both given", |
49 |
function () { |
50 |
oSession.fnRestore(); |
51 |
$('#example').dataTable( { |
52 |
"oLanguage": { |
53 |
"sZeroRecords": "unitest_sZeroRecords2", |
54 |
"sLoadingRecords": "unitest2" |
55 |
}, |
56 |
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt" |
57 |
} ); |
58 |
tmp = $('#example tbody tr td')[0].innerHTML == "unitest2"; |
59 |
}, |
60 |
function () { return tmp; } |
61 |
); |
62 |
|
63 |
|
64 |
oTest.fnComplete(); |
65 |
} ); |