annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/aoColumns.bSearchable.js @ 9:7300ed4c1481 draft default tip

Uploaded
author saskia-hiltemann
date Mon, 04 Sep 2017 10:49:00 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "aoColumns.bSeachable" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 "Columns are searchable by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 function () { oTable.fnFilter("Camino"); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 if ( $('#example tbody tr:eq(0) td:eq(1)')[0] )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 return $('#example tbody tr:eq(0) td:eq(1)').html().match(/Camino/);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 else
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 return null;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 "Disabling sorting on a column removes it from the global filter",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 "aoColumns": [
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 { "bSearchable": false },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 null
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 ]
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 oTable.fnFilter("Camino");
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 "Disabled on one column has no effect on other columns",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 function () { oTable.fnFilter("Webkit"); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 "Disable filtering on multiple columns",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 "aoColumns": [
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 { "bSearchable": false },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 { "bSearchable": false },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 null
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 ]
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 oTable.fnFilter("Webkit");
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 "Filter on second disabled column",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 function () { oTable.fnFilter("Camino"); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 } );