| 1 |
// DATA_TEMPLATE: dom_data |
| 2 |
oTest.fnStart( "2608 - State saving escaping filters" ); |
| 3 |
|
| 4 |
$(document).ready( function () { |
| 5 |
$('#example').dataTable( { |
| 6 |
"bStateSave": true |
| 7 |
} ); |
| 8 |
|
| 9 |
oTest.fnTest( |
| 10 |
"Set the filter", |
| 11 |
function () { |
| 12 |
$('#example_filter input').val( '\\s*CVM\\s*$' ); |
| 13 |
$('#example_filter input').keyup(); |
| 14 |
}, |
| 15 |
function () { return $('#example_filter input').val() == '\\s*CVM\\s*$'; } |
| 16 |
); |
| 17 |
|
| 18 |
oTest.fnTest( |
| 19 |
"Destroy the table and remake it - checking the filter was saved", |
| 20 |
function () { |
| 21 |
$('#example').dataTable( { |
| 22 |
"bStateSave": true, |
| 23 |
"bDestroy": true |
| 24 |
} ); |
| 25 |
}, |
| 26 |
function () { return $('#example_filter input').val() == '\\s*CVM\\s*$'; } |
| 27 |
); |
| 28 |
|
| 29 |
oTest.fnTest( |
| 30 |
"Do it again without state saving and make sure filter is empty", |
| 31 |
function () { |
| 32 |
$('#example').dataTable( { |
| 33 |
"bDestroy": true |
| 34 |
} ); |
| 35 |
}, |
| 36 |
function () { return $('#example_filter input').val() == ''; } |
| 37 |
); |
| 38 |
|
| 39 |
oTest.fnTest( |
| 40 |
"Clean up", |
| 41 |
function () { |
| 42 |
$('#example').dataTable( { |
| 43 |
"bStateSave": true, |
| 44 |
"bDestroy": true |
| 45 |
} ); |
| 46 |
$('#example_filter input').val( '' ); |
| 47 |
$('#example_filter input').keyup(); |
| 48 |
}, |
| 49 |
function () { return $('#example_filter input').val() == ''; } |
| 50 |
); |
| 51 |
|
| 52 |
oTest.fnCookieDestroy( $('#example').dataTable() ); |
| 53 |
oTest.fnComplete(); |
| 54 |
} ); |