jquery - 在拖放时移动匹配的行和父行
问题描述
我想在拖放时将匹配的行与“父”行一起移动。
我有以下代码。
<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();
解决方案
推荐阅读
- ios - 从我的关闭中抛出错误的正确方法?
- python - 无法使用 docker 和 tox 连接到 Postgres 服务
- swift - 如何仅为 git diff 文件运行 swiftlint
- c# - 这种类型的文件可能会损害您的计算机,尝试使用 c# 和 selenium 在 Chrome 中下载 .ini 文件
- android - 我们可以在“native-base”的页脚组件的列中设置两个按钮,还是可以设置“native-base”的页脚高度?
- python-3.x - 如何在用户交互脚本中创建一个循环,可以在图像系列中添加任意数量的标签?
- nested - 在 ionic4 中使用嵌套子路由时,路由在一次主导航更改后停止工作
- javascript - 清除 max-Date 时出现无效日期错误
- vba - 根据电子邮件标题创建文件夹并将电子邮件移动到该文件夹
- ios - 以编程方式获取嵌入在 UIStackView 中的自定义 UIView