首页 > 解决方案 > 在拖放时移动匹配的行和父行

问题描述

我想在拖放时将匹配的行与“父”行一起移动。

我有以下代码。

<table id="sortable">
  <tr data-node-id="1">
    <td>Parent node 1</td>
    <td>Elements of parent node 1</td>
  </tr>
  <tr data-node-pid="1">
    <td>Child node 1</td>
    <td>Elements of child node 1</td>
  </tr>
  <tr data-node-id="2">
    <td>Parent node 2</td>
    <td>Elements of parent node 2</td>
  </tr>
  <tr data-node-pid="2">
    <td>Child node 2</td>
    <td>Elements of child node 2</td>
  </tr>
</table>

我拥有的Jquery:

$(".sortable").sortable({
        cursor: "move",
        placeholder: "sortable-placeholder",
        onUpdate: function (evt) {

        },
    }).disableSelection();

标签: jqueryhtmlsorting

解决方案


推荐阅读