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( {
9 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
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( {
34 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
38 { "sSearch": "Mozilla" },
45 function () { return $('#example_info').html() == "Showing 1 to 9 of 9 entries (filtered from 57 total entries)"; }
49 "Search on two columns - no regex statement given",
52 oTable = $('#example').dataTable( {
53 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
57 { "sSearch": "Mozilla" },
64 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "1.5"; }
68 "Search on single column - escape regex false",
71 oTable = $('#example').dataTable( {
72 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
75 { "sSearch": ".*ML", "bEscapeRegex": false },
83 function () { return $('#example_info').html() == "Showing 1 to 3 of 3 entries (filtered from 57 total entries)"; }
87 "Search on two columns - escape regex false on first, true on second",
90 oTable = $('#example').dataTable( {
91 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
94 { "sSearch": ".*ML", "bEscapeRegex": false },
95 { "sSearch": "3.3", "bEscapeRegex": true },
102 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Konqureror 3.3"; }
106 "Search on two columns (no records) - escape regex false on first, true on second",
108 oSession.fnRestore();
109 oTable = $('#example').dataTable( {
110 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
111 "bDeferRender": true,
113 { "sSearch": ".*ML", "bEscapeRegex": false },
114 { "sSearch": "Allan", "bEscapeRegex": true },
121 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }