1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "fnCreatedCell tests" );
4 $(document).ready( function () {
7 $('#example').dataTable( {
10 fnCreatedCell: function () {
18 "Cell created is called once for each cell on init",
20 function () { return tmp===285; }
24 "Created isn't called back on other draws",
25 function () { $('#example th:eq(1)').click(); },
26 function () { return tmp===285; }
30 "Four arguments for the function",
35 $('#example').dataTable( {
38 fnCreatedRow: function () {
39 if ( arguments.length !== 4 ) {
47 function () { return tmp; }
51 "First argument is a TD element",
56 $('#example').dataTable( {
59 fnCreatedRow: function () {
60 if ( arguments[0].nodeName !== "TD" ) {
68 function () { return tmp; }
72 "Second argument is the HTML value",
77 $('#example').dataTable( {
80 fnCreatedRow: function () {
81 if ( arguments[1] != $('td').html() ) {
89 function () { return tmp; }
93 "Third argument is the data array",
98 $('#example').dataTable( {
101 fnCreatedRow: function () {
102 if ( arguments[2].length !== 5 ) {
110 function () { return tmp; }
114 "Fourth argument is the data source for the row",
116 oSession.fnRestore();
119 $('#example').dataTable( {
122 fnCreatedRow: function () {
123 if ( arguments[2] !== this.fnSettings().aoData[ arguments[2] ]._aData ) {
131 function () { return tmp; }
135 "Fifth argument is the the col index",
137 oSession.fnRestore();
140 $('#example').dataTable( {
143 fnCreatedRow: function () {
144 if ( arguments[1] != $('td:eq('+arguments[4]+')', arguments[0].parentNode).html() ) {
152 function () { return tmp; }