1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aoColumns.fnRender" );
4 $(document).ready( function () {
5 /* Check the default */
7 var oTable = $('#example').dataTable( {
9 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
12 { "fnRender": function (a) {
14 return a.aData[a.iDataColumn];
21 var oSettings = oTable.fnSettings();
24 "Single column - fnRender is called once for each row",
26 function () { return mTmp == 10; }
30 "Confirm that fnRender passes two arguments with four parameters",
34 oTable = $('#example').dataTable( {
36 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
39 { "fnRender": function (a) {
40 if ( arguments.length != 2 || typeof a.iDataRow=='undefined' ||
41 typeof a.iDataColumn=='undefined' || typeof a.aData=='undefined' ||
42 typeof a.mDataProp=='undefined' )
46 return a.aData[a.iDataColumn];
54 function () { return mTmp; }
58 "fnRender iDataColumn is the column",
62 oTable = $('#example').dataTable( {
64 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
67 { "fnRender": function (a) {
68 if ( a.iDataColumn != 1 )
72 return a.aData[a.iDataColumn];
80 function () { return mTmp; }
84 "fnRender aData is data array of correct size",
88 oTable = $('#example').dataTable( {
90 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
93 { "fnRender": function (a) {
94 if ( a.aData.length != 5 )
98 return a.aData[a.iDataColumn];
106 function () { return mTmp; }
110 "Passed back data is put into the DOM",
112 oSession.fnRestore();
113 oTable = $('#example').dataTable( {
115 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
118 { "fnRender": function (a) {
127 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == 'unittest'; }
131 "Passed back data is put into the DOM",
133 oSession.fnRestore();
134 oTable = $('#example').dataTable( {
136 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
140 { "fnRender": function (a) {
143 { "fnRender": function (a) {
152 $('#example tbody tr:eq(0) td:eq(2)').html() == 'unittest1' &&
153 $('#example tbody tr:eq(0) td:eq(3)').html() == 'unittest2';