Reputation: 337
Why first column Row number not update when rowReorder
is false and when rowReorder
is true then only row's first column is Reorder but Row's position is not changed?
var table = $('#tbldynamic').DataTable( {
orderCellsTop: true,
fixedHeader: true,
"scrollY": "400px",
"scrollCollapse": true,
"paging": false,
scrollCollapse: true,
scrollX: true,
"ordering": false,
fixedColumns: {
leftColumns: 0,
rightColumns: 0
},
rowReorder: {
update: false
},
'createdRow': function(row, data, dataIndex){
$(row).attr('id', 'row-' + dataIndex);
}
} );
Upvotes: 2
Views: 158
Reputation: 2918
I Used this js for reordering on my recent project
https://www.jqueryscript.net/table/jQuery-Plugin-To-Reorder-Table-Rows-Via-Drag-Drop-Orderable.html
here a live Demo
for your solution you can use onOrderFinish
onOrderFinish:function (element) { console.info('I\'ve finished reordering! Selected unit: ', element) },
on this event you can rewrite that td block
Upvotes: 1