Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82624

JQuery Datatable Row Reorder

$
0
0

Hi Allan,

I need some help with the Row Reorder Extension. For my datatable, I am using Javascript Sourced Table have added the rowReorder: true in.

According to your examples, I have added in this code

$('#example').on('row-reorder.dt', function (dragEvent, data, nodes) {
                alert('row #' +
                      data[0].node._DT_RowIndex +
                      ' moved from pos ' +
                      data[0].oldPosition +
                      ' to pos ' +
                      data[0].newPosition + "\n" +
                      'row #' +
                      data[1].node._DT_RowIndex +
                      ' changed position from ' +
                      data[1].oldPosition +
                      ' to ' +
                      data[1].newPosition
                     );
                console.log(data);
            });

It is able to tell me which rows changed but there is no changes made. The rows did not remain there after the reorder and returned to the default rows.

Is there any additional step that I need to do? Like physically reorder the Array Sourced data by myself and then reload the table? Because from your examples, it seems that it will automatically update the data row.

Thanks!


Viewing all articles
Browse latest Browse all 82624

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>