跳到主要内容

restoreTableRecords()

function restoreTableRecords(
table,
records,
committed
): void;

Defined in: packages/rxdb-model/src/entity-table/vtable/table-row-move.ts:115

把表格行恢复成最近一次提交的顺序

Parameters​

ParameterTypeDescription
tableListTableAll目标表格实例
recordsEntityTableRecord[]交给表格的那份记录数组(会被原地改回)
committedreadonly EntityTableRecord[]最近一次 setRecords 时记下的顺序副本

Returns​

void

Remarks​

VTable 拖放换位是对传入数组原地 splice,交进去的记录数组此时已是拖后的顺序; 所以宿主组件每次交数据时要另存一份副本,失败或被拒时用它把数组改回去再重绘。