I am using DataTables along with the rowReorder plugin against a static table (non AJAX) - everything initialises fine but when I drag a row, whilst it moves within the tabl
In datatable initialization code, remove order attribute. If we use order then drag and drop will not work.
Example with order - not working
table = $('#ConfigMenuTable').DataTable({
data: testData,
"rowReorder": {
selector: 'td:nth-child(1)'
},
"order":[[ 1, "asc" ]],
"columns": [
{"visible": false},
{"width": "20%", "className": 'reorder'},
{"visible": false,"searchable": true, "width": "15%"},
{"orderable": false, "searchable": false},
{"orderable": false, "searchable": false},
{"orderable": true, "searchable": false}
]
});
Example without order - working
table = $('#ConfigMenuTable').DataTable({
data: testData,
"rowReorder": {
selector: 'td:nth-child(1)'
},
"columns": [
{"visible": false},
{"width": "20%", "className": 'reorder'},
{"visible": false,"searchable": true, "width": "15%"},
{"orderable": false, "searchable": false},
{"orderable": false, "searchable": false},
{"orderable": true, "searchable": false}
]
});