Sha256: b36a74f010fce0a7fb0e9660e1d89bd51213d07214e373d64d2c0e5808b8037c

Contents?: true

Size: 1.37 KB

Versions: 28

Compression:

Stored size: 1.37 KB

Contents

// DATA_TEMPLATE: html_table
oTest.fnStart( "HTML auto detect" );

$(document).ready( function () {
	var oTable = $('#example').dataTable();
	
	oTest.fnTest( 
		"Initial sort",
		null,
		function () {
			var ret =
				$('#example tbody tr:eq(0) td:eq(0)').html() == '1' &&
				$('#example tbody tr:eq(1) td:eq(0)').html() == '2' &&
				$('#example tbody tr:eq(2) td:eq(0)').html() == '3';
			return ret;
		}
	);
	
	oTest.fnTest( 
		"HTML sort",
		function () { $('#example thead th:eq(1)').click() },
		function () {
			var ret =
				$('#example tbody tr:eq(0) td:eq(0)').html() == '2' &&
				$('#example tbody tr:eq(1) td:eq(0)').html() == '1' &&
				$('#example tbody tr:eq(2) td:eq(0)').html() == '4';
			return ret;
		}
	);
	
	oTest.fnTest( 
		"HTML reverse sort",
		function () { $('#example thead th:eq(1)').click() },
		function () {
			var ret =
				$('#example tbody tr:eq(0) td:eq(0)').html() == '3' &&
				$('#example tbody tr:eq(1) td:eq(0)').html() == '4' &&
				$('#example tbody tr:eq(2) td:eq(0)').html() == '1';
			return ret;
		}
	);
	
	oTest.fnTest( 
		"Numeric sort",
		function () { $('#example thead th:eq(0)').click() },
		function () {
			var ret =
				$('#example tbody tr:eq(0) td:eq(0)').html() == '1' &&
				$('#example tbody tr:eq(1) td:eq(0)').html() == '2' &&
				$('#example tbody tr:eq(2) td:eq(0)').html() == '3';
			return ret;
		}
	);
	
	
	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/html-autodetect-sort.js
classiccms-0.7.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.7.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.7.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.7.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.7.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.6.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.5.17 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.5.16 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.5.15 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
classiccms-0.5.14 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js