我正在一个项目中使用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')
,但它没有起作用...
有人成功移动行吗?