Sha256: 12dce2636d602d873e77a22747244bfec759c758900238982b94bc2e47077f13

Contents?: true

Size: 1.76 KB

Versions: 28

Compression:

Stored size: 1.76 KB

Contents

// DATA_TEMPLATE: empty_table
oTest.fnStart( "iDisplayLength" );

$(document).ready( function () {
	/* Check the default */
	$('#example').dataTable( {
		"sAjaxSource": "../../../examples/ajax/sources/arrays.txt"
	} );
	
	oTest.fnWaitTest( 
		"Default length is ten",
		null,
		function () { return $('#example tbody tr').length == 10; }
	);
	
	oTest.fnWaitTest( 
		"Select menu shows 10",
		null,
		function () { return $('#example_length select').val() == 10; }
	);
	
	
	oTest.fnWaitTest( 
		"Set initial length to 25",
		function () {
			oSession.fnRestore();
			$('#example').dataTable( {
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"iDisplayLength": 25
			} );
		},
		function () { return $('#example tbody tr').length == 25; }
	);
	
	oTest.fnWaitTest( 
		"Select menu shows 25",
		null,
		function () { return $('#example_length select').val() == 25; }
	);
	
	
	oTest.fnWaitTest( 
		"Set initial length to 100",
		function () {
			oSession.fnRestore();
			$('#example').dataTable( {
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"iDisplayLength": 100
			} );
		},
		function () { return $('#example tbody tr').length == 57; }
	);
	
	oTest.fnWaitTest( 
		"Select menu shows 25",
		null,
		function () { return $('#example_length select').val() == 100; }
	);
	
	
	oTest.fnWaitTest( 
		"Set initial length to 23 (unknown select menu length)",
		function () {
			oSession.fnRestore();
			$('#example').dataTable( {
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"iDisplayLength": 23
			} );
		},
		function () { return $('#example tbody tr').length == 23; }
	);
	
	oTest.fnWaitTest( 
		"Select menu shows 10 (since 23 is unknow)",
		null,
		function () { return $('#example_length select').val() == 10; }
	);
	
	
	oTest.fnComplete();
} );

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
classiccms-0.5.13 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.12 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.11 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.10 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js
classiccms-0.5.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/3_ajax/iDisplayLength.js