How to handle return value for createdRow callback function
How to handle return value for createdRow callback function
I update from datatables 1.8.2 to 1.10.3 and jQuery 1.4.2 to 1.11.0.
Now I've got a problem with the fnRowCallback, i'm using to convert the original row
<tr><td></td><td></td><td></td></tr>
to someting like this:
<tr><td rowspan=2></td><td>A</td><td>A</td></tr>
<tr><td>B</td><td>B</td></tr>
This worked well before the update:
'fnRowCallback': function (row, data, displayRow, tableRow) {
var newRow = row.cloneNode(true);
$(row).find('td:lt(1)').prop('rowspan', 2);
$(row).find('td:gt(0)').html('A');
$(newRow).find('td:gt(0)').html('B');
var frag = document.createDocumentFragment();
frag.appendChild(row);
frag.appendChild(newRow);
return frag;
},
The problem is, that the result always looks like:
<tr><td rowspan=2></td><td>A</td><td>A</td></tr>
for
return frag; or
return row; or
return newRow; or
row=newRow; (instead of any return ....)
So the function is called and working, but the result is ignored.
Looks like the usage of the "return" has changed. Changing to createdRow( row, data, dataIndex ) as a function didn't help either.
Any ideas, how to fix it?