Sha256: 07d72d94289b37d19198d3ecd43c47744fba6779939b92f37c5c91378de0481d

Contents?: true

Size: 1.51 KB

Versions: 28

Compression:

Stored size: 1.51 KB

Contents

// DATA_TEMPLATE: empty_table
oTest.fnStart( "fnServerData for Ajax sourced data" );

$(document).ready( function () {
	var mPass;
	
	oTest.fnTest( 
		"Argument length",
		function () {
			$('#example').dataTable( {
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"bDeferRender": true,
				"fnServerData": function () {
					mPass = arguments.length;
				}
			} );
		},
		function () { return mPass == 4; }
	);
	
	oTest.fnTest( 
		"Url",
		function () {
			$('#example').dataTable( {
				"bDestroy": true,
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"bDeferRender": true,
				"fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
					mPass = sUrl == "../../../examples/ajax/sources/arrays.txt";
				}
			} );
		},
		function () { return mPass; }
	);
	
	oTest.fnTest( 
		"Data array",
		function () {
			$('#example').dataTable( {
				"bDestroy": true,
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"bDeferRender": true,
				"fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
					mPass = aoData.length==0;
				}
			} );
		},
		function () { return mPass; }
	);
	
	oTest.fnTest( 
		"Callback function",
		function () {
			$('#example').dataTable( {
				"bDestroy": true,
				"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
				"bDeferRender": true,
				"fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
					mPass = typeof fnCallback == 'function';
				}
			} );
		},
		function () { return mPass; }
	);
	
	
	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/6_delayed_rendering/fnServerData.js
classiccms-0.7.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.7.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.7.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.7.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.7.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.6.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.5.17 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.5.16 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.5.15 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js
classiccms-0.5.14 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js