修复拖拽行数据错位问题

This commit is contained in:
Ricky
2021-09-30 15:55:38 +08:00
parent 05ee2d0bf4
commit 0224f58e52
2 changed files with 30 additions and 1 deletions

View File

@ -93,10 +93,26 @@ $.BootstrapTable = class extends $.BootstrapTable {
this.options.data.splice(this.options.data.indexOf(draggingRow), 1)
this.options.data.splice(index, 0, draggingRow)
this.initSearch()
// Call the user defined function
this.options.onReorderRowsDrop(droppedRow)
// Call the event reorder-row
this.trigger('reorder-row', newData, draggingRow, droppedRow)
}
initSearch () {
this.ignoreInitSort = true
super.initSearch()
}
initSort () {
if (this.ignoreInitSort) {
this.ignoreInitSort = false
return
}
super.initSort()
}
}