1 // DATA_TEMPLATE: dom_data
2 oTest.fnStart( "fnCreatedCell tests" );
4 $(document).ready( function () {
7 $('#example').dataTable( {
9 fnCreatedCell: function () {
17 "Cell created is called once for each cell on init",
19 function () { return tmp===285; }
23 "Created isn't called back on other draws",
24 function () { $('#example th:eq(1)').click(); },
25 function () { return tmp===285; }
29 "Four arguments for the function",
34 $('#example').dataTable( {
36 fnCreatedRow: function () {
37 if ( arguments.length !== 4 ) {
45 function () { return tmp; }
49 "First argument is a TD element",
54 $('#example').dataTable( {
56 fnCreatedRow: function () {
57 if ( arguments[0].nodeName !== "TD" ) {
65 function () { return tmp; }
69 "Second argument is the HTML value",
74 $('#example').dataTable( {
76 fnCreatedRow: function () {
77 if ( arguments[1] != $('td').html() ) {
85 function () { return tmp; }
89 "Third argument is the data array",
94 $('#example').dataTable( {
96 fnCreatedRow: function () {
97 if ( arguments[2].length !== 5 ) {
105 function () { return tmp; }
109 "Fourth argument is the data source for the row",
111 oSession.fnRestore();
114 $('#example').dataTable( {
116 fnCreatedRow: function () {
117 if ( arguments[2] !== this.fnSettings().aoData[ arguments[2] ]._aData ) {
125 function () { return tmp; }
129 "Fifth argument is the the col index",
131 oSession.fnRestore();
134 $('#example').dataTable( {
136 fnCreatedRow: function () {
137 if ( arguments[1] != $('td:eq('+arguments[4]+')', arguments[0].parentNode).html() ) {
145 function () { return tmp; }