how to get entire row to swap data with RowReorder?

how to get entire row to swap data with RowReorder?

rozimekrozimek Posts: 1Questions: 1Answers: 0

I have a datatable that takes in an array of objects with a sequence number. I specified the dataSrc on the rowReorder and the only thing that swapped out when dragging and dropping is the sequence number. How do I get it working with the whole row. http://live.datatables.net/rirusulu/13/edit

Answers

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,945
    edited May 2018

    What you describe is how rowReorder works. You would need to sort the table by the sequence number column. Take a look at this example:

    http://live.datatables.net/qinowene/1/edit

    Basically the sequence numbers are swapped and the table is reordered by the sequence number. If you hide column 0 (remove the comment indicator from //visible: false,) you will have a better visualization of the rows being reordered.

    Kevin

This discussion has been closed.