Я знаю, что можно перетаскивать один элемент, но можно ли перетаскивать несколько элементов одновременно? jsfiddle
Код: Выделить всё
$("#table1 tbody").sortable({
connectWith: "#table2 tbody",
helper: function(e, tr) {
const $originals = tr.children();
const $helper = tr.clone();
$helper.children().each(function(index) {
// Set helper cell sizes to match the original sizes
$(this).width($originals.eq(index).width());
});
return $helper;
},
start: function(e, ui) {},
stop: function(e, ui) {},
receive: function(e, ui) {},
axis: "xy",
});
$("#table2 tbody").sortable({
connectWith: "#table1 tbody",
helper: function(e, tr) {
const $originals = tr.children();
const $helper = tr.clone();
$helper.children().each(function(index) {
// Set helper cell sizes to match the original sizes
$(this).width($originals.eq(index).width());
});
return $helper;
},
start: function(e, ui) {},
update: function(e, ui) {},
receive: function(e, ui) {},
axis: "xy",
});
Код: Выделить всё
Name
Description
Type
N1
D1
T1
N2
D2
T2
Name
Description
Type
N3
D3
T3
N4
D4
T4
Подробнее здесь: https://stackoverflow.com/questions/786 ... cted-items