-
Notifications
You must be signed in to change notification settings - Fork 436
Closed
Description
I have tables with many cols and the js as provided in the example only seems to work consistently on tables with 2 cols.
I rewrote onDrop to the following that seems to be working consistently:
onDrop: function ($item, container, _super) {
var field;
var newIndex = $item.index();
if(newIndex != oldIndex) {
$item.closest('table').find('tbody tr').each(function (i, row) {
row = $(row);
if(newIndex < oldIndex) {
row.children().eq(newIndex).before(row.children()[oldIndex]);
} else if (newIndex > oldIndex) {
row.children().eq(newIndex).after(row.children()[oldIndex]);
}
})
}
_super($item, container);
}
Comments?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels