DataTables v1.10 & RowReordering

DataTables v1.10 & RowReordering

frederic123frederic123 Posts: 3Questions: 2Answers: 0

Hi,

I try to understand why this new function - rowReorder - does not work as it could be. In fact, the plugin itself works perfectly : I can easy drag & drop the entire row.; however, it does not save his new position so I always get the initial order (which is useless then).

Can u please let me know what's wrong here :

I post an example on jsfiddle. : https://jsfiddle.net/frederic123/wrhh3tbu/

Regards,

Frederic

This question has an accepted answers - jump to answer

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited October 2015 Answer ✓

    Took me a minute, but I got it.

    Since you're using a JSON data source, you need to specify the rowReorder.dataSrc.. Im guessing its because DT needs to update the sequence order from the data source when it re-orders rows, when its the DOM, thats done automatically, when its not the DOM, it needs to know which property it should update.. Just an educated guess though

    Heres your example updated with the rowReorder.dataSrc set to r

    The rowReorder.dataSrc tells the rowReorder extension which property from the data source to use as the row-reorder.. in your case, r

  • frederic123frederic123 Posts: 3Questions: 2Answers: 0

    Thanks - works perfectly now !

This discussion has been closed.