我有个问题。它是关于编辑表格中的选定行。表格中的每一行在末尾都有用于编辑自我的按钮。如果单击此按钮,我可以看到编辑窗口以编辑表中选定的数据行。我正在使用 Bootstrap,但遇到了问题。如何获取编辑窗口并在编辑窗口上单击保存以用新值替换所选行?
最好看我的例子!
这是我的 **演示
添加新行的按钮
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
+ Define a new visual feature
</button>
表添加新行。
<table class="table table-striped" id="table-visual-features">
<thead>
<tr>
<th>Visual Feature</th>
<th>Type [currently not used]</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
这是一个值,在表中的选定行中具有该值。我想使用 Bootstrap 使用编辑窗口编辑此值
console.log($(this).closest('tr').children('td').eq(0).text());
console.log($(this).closest('tr').children('td').eq(1).text());
console.log($(this).closest('tr').children('td').eq(2).text())