DataTables Rows Reorder - Sorting failure when adding same row again

DataTables Rows Reorder - Sorting failure when adding same row again

vsh0001vsh0001 Posts: 2Questions: 1Answers: 0
edited February 2021 in Free community support

DataTable 1: Select row to add to DataTable 2
DataTable 2: Reorderable Table. Have a column ID.

Second datatable shall be like as a playlist. You can add rows multiple times from the DataTable 1.
When i select a row on the left side and click on my add-button, it will copy it to the second table.
But it is copying as a reference. After adding, i have to same rows with same IDs, so that ReOrder won't work anymore.

table2.rows('.active').every( function ( rowIdx, tableLoop, rowLoop ) {
    let data = this.data();
    data.id = table3.data().count()+1;
    console.log(data.id);
    table3.row.add(  data   ).draw()
} );

How can i add the rows as a new row, so that they are not coupled?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.