mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-12 00:08:48 +01:00
61 lines
1.2 KiB
JavaScript
61 lines
1.2 KiB
JavaScript
|
// DATA_TEMPLATE: dom_data
|
||
|
oTest.fnStart( "Odd and even are stripped from all rows" );
|
||
|
|
||
|
$(document).ready( function () {
|
||
|
$('table tbody tr').addClass( 'odd even' );
|
||
|
$('table.display').dataTable();
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Odd is applied to exactly 5 rows",
|
||
|
null,
|
||
|
function () {
|
||
|
return $('#example tbody tr.odd').length === 5;
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Even is applied to exactly 5 rows",
|
||
|
null,
|
||
|
function () {
|
||
|
return $('#example tbody tr.even').length === 5;
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"First row is odd",
|
||
|
null,
|
||
|
function () {
|
||
|
return $('#example tbody tr:eq(0)').hasClass('odd') &&
|
||
|
! $('#example tbody tr:eq(0)').hasClass('even');
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Second row is even",
|
||
|
null,
|
||
|
function () {
|
||
|
return $('#example tbody tr:eq(1)').hasClass('even') &&
|
||
|
! $('#example tbody tr:eq(1)').hasClass('odd');
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Third row is odd",
|
||
|
null,
|
||
|
function () {
|
||
|
return $('#example tbody tr:eq(2)').hasClass('odd') &&
|
||
|
! $('#example tbody tr:eq(2)').hasClass('even');
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Fourth row is even",
|
||
|
null,
|
||
|
function () {
|
||
|
return $('#example tbody tr:eq(3)').hasClass('even') &&
|
||
|
! $('#example tbody tr:eq(3)').hasClass('odd');
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnComplete();
|
||
|
} );
|