/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.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: 2043 byte(s)
initial import
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aoColumns.bSeachable" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt"
8 } );
9 var oSettings = oTable.fnSettings();
10
11 oTest.fnWaitTest(
12 "Columns are searchable by default",
13 function () { oTable.fnFilter("Camino"); },
14 function () {
15 if ( $('#example tbody tr:eq(0) td:eq(1)')[0] )
16 return $('#example tbody tr:eq(0) td:eq(1)').html().match(/Camino/);
17 else
18 return null;
19 }
20 );
21
22 oTest.fnWaitTest(
23 "Disabling sorting on a column removes it from the global filter",
24 function () {
25 oSession.fnRestore();
26 oTable = $('#example').dataTable( {
27 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
28 "aoColumns": [
29 null,
30 { "bSearchable": false },
31 null,
32 null,
33 null
34 ]
35 } );
36 oSettings = oTable.fnSettings();
37 oTable.fnFilter("Camino");
38 },
39 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
40 );
41
42 oTest.fnWaitTest(
43 "Disabled on one column has no effect on other columns",
44 function () { oTable.fnFilter("Webkit"); },
45 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
46 );
47
48 oTest.fnWaitTest(
49 "Disable filtering on multiple columns",
50 function () {
51 oSession.fnRestore();
52 oTable = $('#example').dataTable( {
53 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
54 "aoColumns": [
55 { "bSearchable": false },
56 { "bSearchable": false },
57 null,
58 null,
59 null
60 ]
61 } );
62 oSettings = oTable.fnSettings();
63 oTable.fnFilter("Webkit");
64 },
65 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
66 );
67
68 oTest.fnWaitTest(
69 "Filter on second disabled column",
70 function () { oTable.fnFilter("Camino"); },
71 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
72 );
73
74
75 oTest.fnComplete();
76 } );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20