Merge branch 'master' into PROT-9-webservice
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 5_ajax_objects / aoColumns.bSearchable.js
diff --git a/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/aoColumns.bSearchable.js b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/aoColumns.bSearchable.js
new file mode 100755 (executable)
index 0000000..9f963f9
--- /dev/null
@@ -0,0 +1,83 @@
+// DATA_TEMPLATE: empty_table
+oTest.fnStart( "aoColumns.bSeachable" );
+
+$(document).ready( function () {
+       /* Check the default */
+       var oTable = $('#example').dataTable( {
+               "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
+               "aoColumns": [
+                       { "mData": "engine" },
+                       { "mData": "browser" },
+                       { "mData": "platform" },
+                       { "mData": "version" },
+                       { "mData": "grade" }
+               ]
+       } );
+       var oSettings = oTable.fnSettings();
+       
+       oTest.fnWaitTest( 
+               "Columns are searchable by default",
+               function () { oTable.fnFilter("Camino"); },
+               function () {
+                       if ( $('#example tbody tr:eq(0) td:eq(1)')[0] )
+                               return $('#example tbody tr:eq(0) td:eq(1)').html().match(/Camino/);
+                       else
+                               return null;
+               }
+       );
+       
+       oTest.fnWaitTest( 
+               "Disabling sorting on a column removes it from the global filter",
+               function () {
+                       oSession.fnRestore();
+                       oTable = $('#example').dataTable( {
+                               "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
+                               "aoColumns": [
+                                       { "mData": "engine" },
+                                       { "mData": "browser", "bSearchable": false },
+                                       { "mData": "platform" },
+                                       { "mData": "version" },
+                                       { "mData": "grade" }
+                               ]
+                       } );
+                       oSettings = oTable.fnSettings();
+                       oTable.fnFilter("Camino");
+               },
+               function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
+       );
+       
+       oTest.fnWaitTest( 
+               "Disabled on one column has no effect on other columns",
+               function () { oTable.fnFilter("Webkit"); },
+               function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
+       );
+       
+       oTest.fnWaitTest( 
+               "Disable filtering on multiple columns",
+               function () {
+                       oSession.fnRestore();
+                       oTable = $('#example').dataTable( {
+                               "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
+                               "aoColumns": [
+                                       { "mData": "engine", "bSearchable": false },
+                                       { "mData": "browser", "bSearchable": false },
+                                       { "mData": "platform" },
+                                       { "mData": "version" },
+                                       { "mData": "grade" }
+                               ]
+                       } );
+                       oSettings = oTable.fnSettings();
+                       oTable.fnFilter("Webkit");
+               },
+               function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
+       );
+       
+       oTest.fnWaitTest( 
+               "Filter on second disabled column",
+               function () { oTable.fnFilter("Camino"); },
+               function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
+       );
+       
+       
+       oTest.fnComplete();
+} );
\ No newline at end of file