Rowreorder ... row jumps back to the original position
Rowreorder ... row jumps back to the original position
jawadahm
Posts: 3Questions: 1Answers: 0
I am trying to add row reording based on the rowreorder plugin and examples. When I drag a row to the new row, it jumps back to the original row. Live example is demoed here "live.datatables.net/jipiwoqa/1/edit"
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to have a "sequence" column that is used for the reordering. Your updated example:
http://live.datatables.net/tobexaci/1/edit
I added a column with sequence numbers and also added the RowReorder CSS.
This is the same as the basic example:
https://datatables.net/extensions/rowreorder/examples/initialisation/simple.html
The second paragraph [here[(https://datatables.net/extensions/rowreorder/) explains why the need for sequential numbers.
Kevin
If this is really about the sequence number then why it is working in other example where sequence is not present. Have a look at this example: https://datatables.net/extensions/rowreorder/examples/initialisation/selector.html
Good question. When you look at the Datatable none of the visible columns are sorted. There is also a hidden column:
By default Datatables sorts on column 0. If you click the HTML tab you will see column 0 contains sequence numbers.
Kevin
Ok I got your point. I think that I have found a solution. https://datatables.net/reference/option/rowReorder.update
I set this property to false and I am able to see the change and now it is working.
live example: http://live.datatables.net/ninolaga/1/edit