comparison DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/fnServerData.js @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ac5f9272033b
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "fnServerData for Ajax sourced data" );
3
4 $(document).ready( function () {
5 var mPass;
6
7 oTest.fnTest(
8 "Argument length",
9 function () {
10 $('#example').dataTable( {
11 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
12 "bDeferRender": true,
13 "fnServerData": function () {
14 mPass = arguments.length;
15 }
16 } );
17 },
18 function () { return mPass == 4; }
19 );
20
21 oTest.fnTest(
22 "Url",
23 function () {
24 $('#example').dataTable( {
25 "bDestroy": true,
26 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
27 "bDeferRender": true,
28 "fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
29 mPass = sUrl == "../../../examples/ajax/sources/arrays.txt";
30 }
31 } );
32 },
33 function () { return mPass; }
34 );
35
36 oTest.fnTest(
37 "Data array",
38 function () {
39 $('#example').dataTable( {
40 "bDestroy": true,
41 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
42 "bDeferRender": true,
43 "fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
44 mPass = aoData.length==0;
45 }
46 } );
47 },
48 function () { return mPass; }
49 );
50
51 oTest.fnTest(
52 "Callback function",
53 function () {
54 $('#example').dataTable( {
55 "bDestroy": true,
56 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
57 "bDeferRender": true,
58 "fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
59 mPass = typeof fnCallback == 'function';
60 }
61 } );
62 },
63 function () { return mPass; }
64 );
65
66
67 oTest.fnComplete();
68 } );