@泳道/虚拟滚动仅适用于缓存的行。缓存的行保存在数组中。在我的例子中,该行的数目可能超过1,000万。如何不缓存该行并使用虚拟滚动?
问题的再现:
1)没有缓存行的当前行为虚拟滚动示例:http://prntscr.com/kw9q51
2)回购:https://github.com/DmitriyIvanko/ngx-datatable-example/blob/master/src/app/app.component.ts
发布于 2019-02-21 16:45:27
我的hack解决方案是模拟缓存的行:例如,用户请求获取: 20行,跳过: 50行,总计行: 100;创建‘un定义’数组(长度为100),并替换从第50行开始的20行;
const totalRow = 100;
const skip = 50;
const take = 20;
const serverRow = [{...}] // array of row, with length = 20;
const resultList = new Array(totalRow).fill(undefined);
resultList.splice(skip, serverRow.length, ...serverRow);我用一千万行来检查这个解决方案,它运行得非常快;也许这会对某人有所帮助。
https://stackoverflow.com/questions/52408896
复制相似问题