row reordering now working

row reordering now working

rkshirsagarrkshirsagar Posts: 9Questions: 5Answers: 0

code:
var temp = $(tableid).DataTable({
"data": res,
deferRender: true,
"scrollY": scorllY,
"scrollX":false,
"scrollCollapse": true,
"scroller" :true,
"paging":true,
"language": {
"zeroRecords": emptyLabel
},
"autoWidth": false,
'dom': dom,
"rowReorder":{update: true},
"columnDefs":[{ }]
});
row reordering now working. row come back to its original position

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    Sounds like the column you are using for sorting isn't an index column. The RowReorder docs state this:

    The data point in the row that is modified is defined by the rowReorder.dataSrc. Normally you will want this to be a sequential number! The data reorder can potentially confuse end users otherwise!

    See this example.

    In order to help we will need to see what you have so. we can offer suggestions. Please post a link to your page or a test case replicating the problem so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • rkshirsagarrkshirsagar Posts: 9Questions: 5Answers: 0
    edited June 2021

    If I use "rowReorder":{update: true} property, it prevents row to be dropped. it reverts back row to original position. & If I use "rowReorder":{update: false} row reorder works but its event after row drop i.e. row-reordered does not get called.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    In order to help we will need to see what you have so. we can offer suggestions. Please post a link to your page or a test case replicating the problem so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

Sign In or Register to comment.