Datatables + responsive + rowreorder problem together?

Datatables + responsive + rowreorder problem together?

itajackassitajackass Posts: 121Questions: 37Answers: 3

I've a problem with responsive (ON FIRST COLUMN) and ROWREORDER (SECOND COLUMN).
Firt column: CORRECT, i see "+" indicate responsive plugin is ok. It works. Second column: Ordering seems to be ok, but if drag-drop rows, it reverse back to original position. Also the ordering icon inside thead is in the first column (not the second as expected).

My fiddle: http://jsfiddle.net/UvjnT/2574/

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin

    You need to set the rowReorder.dataSrc option as well: https://jsfiddle.net/UvjnT/2586/ .

    Note that RowReorder implements a data swap method, rather than simply moving the DOM nodes. That might or might not be what you want.

    Allan

  • itajackassitajackass Posts: 121Questions: 37Answers: 3
    Answer ✓

    Hi, i tried your fiddle but doesn't work... ordering number sequence breaks! I had to modify my fiddle to set responsive in second column, and ordering on first.
    Working fiddle:
    http://jsfiddle.net/UvjnT/2591/

  • edboyeredboyer Posts: 3Questions: 0Answers: 0
    edited July 2019

    I had to add a default sort order to Allan's example to sort on the Order column. order: [[1, 'asc']],

    Otherwise it was not working correctly, I believe since it was sorting on the responsive control column

This discussion has been closed.