Trial - boosting prospect grid loading performance

This commit is contained in:
troogs
2026-09-20 11:09:44 +02:00
parent 8b298b37c7
commit b33f9f6c52
15 changed files with 688 additions and 73 deletions
@@ -0,0 +1,23 @@
export function attachScrollLoader(gridId, component) {
const grid = document.getElementById(gridId);
if (!grid) return;
const checkScroll = () => {
const distanceFromBottom = grid.scrollHeight - (grid.scrollTop + grid.clientHeight);
if (distanceFromBottom < 250) {
component.invokeMethodAsync('OnScrollNearBottom');
}
};
grid.addEventListener('scroll', checkScroll, { passive: true });
grid.__prospectScrollCheck = checkScroll;
checkScroll();
}
export function disposeScrollLoader(gridId) {
const grid = document.getElementById(gridId);
if (!grid || !grid.__prospectScrollCheck) return;
grid.removeEventListener('scroll', grid.__prospectScrollCheck);
delete grid.__prospectScrollCheck;
}