mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-05 17:24:10 +01:00
71 lines
1.8 KiB
JavaScript
71 lines
1.8 KiB
JavaScript
|
// DATA_TEMPLATE: js_data
|
||
|
oTest.fnStart( "aoColumns.bSeachable" );
|
||
|
|
||
|
$(document).ready( function () {
|
||
|
/* Check the default */
|
||
|
var oTable = $('#example').dataTable( {
|
||
|
"aaData": gaaData
|
||
|
} );
|
||
|
var oSettings = oTable.fnSettings();
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Columns are searchable by default",
|
||
|
function () { oTable.fnFilter("Camino"); },
|
||
|
function () { return $('#example tbody tr:eq(0) td:eq(1)').html().match(/Camino/); }
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"Disabling sorting on a column removes it from the global filter",
|
||
|
function () {
|
||
|
oSession.fnRestore();
|
||
|
oTable = $('#example').dataTable( {
|
||
|
"aaData": gaaData,
|
||
|
"aoColumns": [
|
||
|
null,
|
||
|
{ "bSearchable": false },
|
||
|
null,
|
||
|
null,
|
||
|
null
|
||
|
]
|
||
|
} );
|
||
|
oSettings = oTable.fnSettings();
|
||
|
oTable.fnFilter("Camino");
|
||
|
},
|
||
|
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"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.fnTest(
|
||
|
"Disable filtering on multiple columns",
|
||
|
function () {
|
||
|
oSession.fnRestore();
|
||
|
oTable = $('#example').dataTable( {
|
||
|
"aaData": gaaData,
|
||
|
"aoColumns": [
|
||
|
{ "bSearchable": false },
|
||
|
{ "bSearchable": false },
|
||
|
null,
|
||
|
null,
|
||
|
null
|
||
|
]
|
||
|
} );
|
||
|
oSettings = oTable.fnSettings();
|
||
|
oTable.fnFilter("Webkit");
|
||
|
},
|
||
|
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "No matching records found"; }
|
||
|
);
|
||
|
|
||
|
oTest.fnTest(
|
||
|
"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();
|
||
|
} );
|