restoreTableRecords()
function restoreTableRecords(
table,
records,
committed
): void;
Defined in: packages/rxdb-model/dist/entity-table/vtable/table-row-move.d.ts:87
把表格行恢复成最近一次提交的顺序
Parameters
| Parameter | Type | Description |
|---|---|---|
table | ListTableAll | 目标表格实例 |
records | EntityTableRecord[] | 交给表格的那份记录数组(会被原地改回) |
committed | readonly EntityTableRecord[] | 最近一次 setRecords 时记下的顺序副本 |
Returns
void
Remarks
VTable 拖放换位是对传入数组原地 splice,交进去的记录数组此时已是拖后的顺序;
所以宿主组件每次交数据时要另存一份副本,失败或被拒时用它把数组改回去再重绘。