Я знаю, что можно перетаскивать один элемент, но можно ли перетаскивать несколько элементов одновременно?
Код: Выделить всё
$("#table1 tbody").sortable({
connectWith: "#table2 tbody",
helper: function(e, item) {
var $helper = $("");
// Check the row that user is moving
item.find("td").eq(0).find("input")[0].checked = true;
const nodes = item.parent().children(":has(input:checked)").clone();
item.data("nodes", nodes).siblings(":has(input:checked)").remove();
return $helper.append(nodes);
},
start: function(e, ui) {},
stop: function(e, ui) {
var nodes = ui.item.data("nodes");
ui.item.after(nodes).remove();
},
receive: function(e, ui) {},
axis: "xy",
});
$("#table2 tbody").sortable({
connectWith: "#table1 tbody",
helper: function(e, item) {
var $helper = $("");
// Check the row that user is moving
item.find("td").eq(0).find("input")[0].checked = true;
const nodes = item.parent().children(":has(input:checked)").clone();
item.data("nodes", nodes).siblings(":has(input:checked)").remove();
return $helper.append(nodes);
},
stop: function(e, ui) {
var nodes = ui.item.data("nodes");
ui.item.after(nodes).remove();
},
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