VTable icon indicating copy to clipboard operation
VTable copied to clipboard

[Feature] 优化 addRecords 方法,避免多组数据插入到不同row时多次渲染

Open QaQ-top opened this issue 1 year ago • 0 comments

What problem does this feature solve?

避免多组数据插入到不同row时多次渲染

What does the proposed API look like?

 batchAddRecords(fn:  (param: (records: any[], recordIndex?: number) => void) => void ) {
  fn(this.addRecords.bind(this)) // 批量处理数据
  renderSceneGraph() // 统一渲染
}
 
table.batchAddRecords((addRecords) =>{
  const group = [{dataList: [{a: 1}], row: 1}, {dataList: [{a: 2}], row: 4];
  group.forEach(({dataList, row }) => addRecords(dataList, row))
})

QaQ-top avatar Aug 12 '24 09:08 QaQ-top