Each() mising first row from table source
Each() mising first row from table source
cipraen
Posts: 4Questions: 3Answers: 0
Any idea why the first row of data from the source table is always skipped when iterating?
var tableSource= $('#tableSource').DataTable();
tableSource
.column( 2 )
.data()
.each( function ( value, index ) {
//console.log( 'Data in index: '+index+' is: '+value );
$('#tableTarget > tbody > tr:nth-child('+index+')').append('<td>'+value+'</td>');
});
The tableSource is already a datatable. What I'm trying to do is copy a column from tableSource to the tableTarget, but everytime the code runs the first row from the tableSource is skipped.
This discussion has been closed.
Answers
Hi,
It appears to work as expected here: http://live.datatables.net/dirakake/1/edit .
Can you link to a test case showing the issue, as per the forum rules please.
Allan