rowreorder events
rowreorder events

It's hard to understand for me somtimes, could you help me.
I got a problem with reorder event
My code
var table = $("#reorderJson").DataTable( {
"ajax": "/apiroder",
"rowReorder": true,
"columns": [
{ "data": "idorder" },
{ "data": "id" },
{ "data": "label" },
{ "data": "type" },
{ "data": "idfield" },
],
} );
table.on( 'row-reorder', function ( e, diff, edit ) {
var result = 'La remise en ordre a commencé a la ligne : '+edit.triggerRow.data()["idorder"]+'<br>';
for ( var i=0, ien=diff.length ; i<ien ; i++ ) {
var rowData = table.row( diff[i].node ).data();
result += rowData["idorder"]+' va passer en position '+
diff[i].newData+' (auparavant '+diff[i].oldData+')<br>';
}
$("#result").html( 'Changements effectués:<br>'+result );
} );
It gives me
Changements effectués:
La remise en ordre a commencé a la ligne : 4
5 va passer en position undefined (auparavant undefined)
6 va passer en position undefined (auparavant undefined)
4 va passer en position undefined (auparavant undefined)
I don't know why UNDEFINED !
Thanks
This discussion has been closed.
Answers
Hi @sebd ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin