1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aoSearchCols" );
4 /* We could be here forever testing this one, so we test a limited subset on a couple of colums */
6 $(document).ready( function () {
7 /* Check the default */
8 var oTable = $('#example').dataTable( {
10 "sAjaxSource": "../../../examples/server_side/scripts/filter_col.php"
12 var oSettings = oTable.fnSettings();
15 "Default should be to have a empty colums array",
19 oSettings.aoPreSearchCols[0].sSearch == 0 && !oSettings.aoPreSearchCols[0].bRegex &&
20 oSettings.aoPreSearchCols[1].sSearch == 0 && !oSettings.aoPreSearchCols[1].bRegex &&
21 oSettings.aoPreSearchCols[2].sSearch == 0 && !oSettings.aoPreSearchCols[2].bRegex &&
22 oSettings.aoPreSearchCols[3].sSearch == 0 && !oSettings.aoPreSearchCols[3].bRegex &&
23 oSettings.aoPreSearchCols[4].sSearch == 0 && !oSettings.aoPreSearchCols[4].bRegex;
30 "Search on a single column - no regex statement given",
33 oTable = $('#example').dataTable( {
35 "sAjaxSource": "../../../examples/server_side/scripts/filter_col.php",
38 { "sSearch": "Mozilla" },
45 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "1"; }
49 "Search on two columns - no regex statement given",
52 oTable = $('#example').dataTable( {
54 "sAjaxSource": "../../../examples/server_side/scripts/filter_col.php",
57 { "sSearch": "Mozilla" },
64 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "1.5"; }
67 /* No regex escape searches here - would need to be implemented on the server-side */