Sha256: b36f7f97f0b14c66464ae8f618760b6dfd2ce419894b09f46efeb027603b9ff0

Contents?: true

Size: 1.78 KB

Versions: 28

Compression:

Stored size: 1.78 KB

Contents

// DATA_TEMPLATE: 6776
oTest.fnStart( "Actions on a scrolling table keep width" );


$(document).ready( function () {
	var oTable = $('#example').dataTable( {
        "bFilter": true,
        "bSort": true,
        "sScrollY": "100px",
        "bPaginate": false
	} );
	
	var iWidth = $('div.dataTables_wrapper').width();

	oTest.fnTest( 
		"First sort has no effect on width",
		function () { $('th:eq(1)').click(); },
		function () { return $('div.dataTables_wrapper').width() == iWidth; }
	);

	oTest.fnTest( 
		"Second sort has no effect on width",
		function () { $('th:eq(1)').click(); },
		function () { return $('div.dataTables_wrapper').width() == iWidth; }
	);

	oTest.fnTest( 
		"Third sort has no effect on width",
		function () { $('th:eq(2)').click(); },
		function () { return $('div.dataTables_wrapper').width() == iWidth; }
	);

	oTest.fnTest( 
		"Filter has no effect on width",
		function () { oTable.fnFilter('i'); },
		function () { return $('div.dataTables_wrapper').width() == iWidth; }
	);

	oTest.fnTest( 
		"Filter 2 has no effect on width",
		function () { oTable.fnFilter('in'); },
		function () { return $('div.dataTables_wrapper').width() == iWidth; }
	);

	oTest.fnTest( 
		"No result filter has header and body at same width",
		function () { oTable.fnFilter('xxx'); },
		function () { return $('#example').width() == $('div.dataTables_scrollHeadInner').width(); }
	);

	oTest.fnTest( 
		"Filter with no results has no effect on width",
		function () { oTable.fnFilter('xxx'); },
		function () { return $('div.dataTables_wrapper').width() == iWidth; }
	);

	oTest.fnTest( 
		"Filter with no results has table equal to wrapper width",
		function () { oTable.fnFilter('xxx'); },
		function () { return $('div.dataTables_wrapper').width() == $('#example').width(); }
	);
	
	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/1_dom/6776-scrolling-table-grows.js
classiccms-0.7.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.7.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.7.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.7.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.7.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.6.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.5.17 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.5.16 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.5.15 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js
classiccms-0.5.14 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/6776-scrolling-table-grows.js