【发布时间】:2015-07-16 04:43:56
【问题描述】:
我在一个项目中使用Bootstrap-Table,我想向上或向下移动行。
我有这些动作事件:
window.actionEvents = {
'click .up': function (e, value, row, index) {
var thisrow = $(this).parents("tr:first"),
thisrow.prev().data('index', rowindex);
},
'click .down': function (e, value, row, index) {
var thisrow = $(this).parents("tr:first");
thisrow.insertAfter(thisrow.next());
},
}
它在屏幕上移动行,但由于行索引没有改变,所以效果并不好......
所以我尝试更改行 .data('index') 但它不起作用...
有人成功移动行吗?
【问题讨论】:
-
你能提供一个小提琴吗???
-
这里是小提琴:jsfiddle.net/dfpo899p 如果您通过单击 + 或 - 移动行并按下按钮,您可以看到数据保持不变,如果我通过示例添加删除按钮会导致问题.. .
标签: javascript jquery twitter-bootstrap bootstrap-table