Sha256: eccabdb8764f8b8ea111a4ba60b218e732aec481c5fedb8b907a9dfb4c324625

Contents?: true

Size: 2 KB

Versions: 28

Compression:

Stored size: 2 KB

Contents

// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.bSeachable" );

$(document).ready( function () {
	/* Check the default */
	var oTable = $('#example').dataTable( {
		"sAjaxSource": "../../../examples/ajax/sources/arrays.txt"
	} );
	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/arrays.txt",
				"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.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/arrays.txt",
				"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.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();
} );

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
classiccms-0.7.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.7.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.7.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.7.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.7.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.7.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.6.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.5.17 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.5.16 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.5.15 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js
classiccms-0.5.14 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/aoColumns.bSearchable.js