Reorder with hidden sequence number?
Reorder with hidden sequence number?
Hi,
we use the RowReorder extension but we want to hide the actual sequence number. A simplified version of attempt on the link below.
Link to test case: https://jsfiddle.net/pehol/2eakmygu/
Debugger code (debug.datatables.net):
Error messages shown: -
Description of problem: When the row is dropped it jumps back to its original position rather than staying at the new position. Is it a bug? Can it be accomplished differently?
Thanks,
Per
This question has an accepted answers - jump to answer
Answers
Its not a bug. You don't have the
seq
object assigned to a column withcolumns.data
. You changed it to a function. Instead of a function usecolumns.render
and assigncolumns.data
toseq
. Like this:https://jsfiddle.net/w6u9g1he/
Kevin
Oh, thank you for the solution
I didn't understand the difference between "data" and "render".
You have this for
columns.data
:And you are specifying the
rowGroup.dataSrc
like this:Using a function for
columns.data
doesn't set the object key toseq
so therowGroup.dataSrc
setting is invalid. I updated your example to compare the Datatables settings for column 0 and 1:https://jsfiddle.net/fqobhz28/
The change I made:
Sets the key to
seq
and uses render to display the bullet. Now therowGroup.dataSrc
is set for the correct column. I updated my example to compare the same output:https://jsfiddle.net/gdvkyjxu/
HTH,
Kevin