[datatable 1.10.18] reorder failed

[datatable 1.10.18] reorder failed

boss489boss489 Posts: 3Questions: 0Answers: 0
edited February 2019 in Free community support

i wanted user to sort the column manually. so i use the option {ordering : true}.
but this things make first column ordered automatically. that was not what I wanted
So i added the option {order : []} to stop automatic sorting.

but that option had a side effect.. after adding it, reorder option wont work properly.

is there any suggestion?

 $(id).DataTable({
            ordering: true, 
            order: [],                      
            rowReorder: true
        });

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @boss489 ,

    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

  • boss489boss489 Posts: 3Questions: 0Answers: 0
    edited February 2019
  • boss489boss489 Posts: 3Questions: 0Answers: 0
  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @boss489 ,

    That's actually behaving as expected - the effect you're seeing is similar to this example if you order by the Name column and then reorder rows.

    On the front page of RowReorder , it says "RowReorder operates on a data swap method so it can operate even on non-sequential data.". So, in your example, if you drag the second row to the top, you'll see the 22 and the 2 flip. It does look odd, but it's expected to be used when ordering by the sequence column.

    Hope that makes sense,

    Cheers,

    Colin

This discussion has been closed.