/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/bFilter.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/bFilter.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: application/javascript
File size: 1719 byte(s)
initial import
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "bFilter" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
8 "aoColumns": [
9 { "mData": "engine" },
10 { "mData": "browser" },
11 { "mData": "platform" },
12 { "mData": "version" },
13 { "mData": "grade" }
14 ]
15 } );
16
17 oTest.fnWaitTest(
18 "Filtering div exists by default",
19 null,
20 function () { return document.getElementById('example_filter') != null; }
21 );
22
23 /* Check can disable */
24 oTest.fnWaitTest(
25 "Fltering can be disabled",
26 function () {
27 oSession.fnRestore();
28 $('#example').dataTable( {
29 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
30 "aoColumnDefs": [
31 { "mData": "engine", "aTargets": [0] },
32 { "mData": "browser", "aTargets": [1] },
33 { "mData": "platform", "aTargets": [2] },
34 { "mData": "version", "aTargets": [3] },
35 { "mData": "grade", "aTargets": [4] }
36 ],
37 "bFilter": false
38 } );
39 },
40 function () { return document.getElementById('example_filter') == null; }
41 );
42
43 /* Enable makes no difference */
44 oTest.fnWaitTest(
45 "Filtering enabled override",
46 function () {
47 oSession.fnRestore();
48 $('#example').dataTable( {
49 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
50 "aoColumnDefs": [
51 { "mData": "engine", "aTargets": [0] },
52 { "mData": "browser", "aTargets": [1] },
53 { "mData": "platform", "aTargets": [2] },
54 { "mData": "version", "aTargets": [3] },
55 { "mData": "grade", "aTargets": [4] }
56 ],
57 "bFilter": true
58 } );
59 },
60 function () { return document.getElementById('example_filter') != null; }
61 );
62
63
64 oTest.fnComplete();
65 } );

  ViewVC Help
Powered by ViewVC 1.1.20