Infinite scroll
View sourceStream blocks from a server endpoint. The grid maintains an LRU cache of fetched blocks and prefetches the next block in the scroll direction; sort / filter / search refire the block stream from the start.
100,000 rows behind a block fetcher. Scroll fast and watch blocks load on demand.
Try this
- Scroll fast — new blocks load on demand. Old blocks stay cached.
- Click a sortable header — the cache invalidates, new blocks stream.
- Search — same: blocks refresh against the filtered set.
- No page chrome — pagination is silent and invisible to the user.
loadBlock vs loadPage
- paged. The user navigates with chrome (page chevrons, page-size dropdown). One page is in memory at a time. Use this for long lists where the user knows roughly where they are heading.
- infinite. The user scrolls. Multiple blocks stay cached for fluid back-scroll. Use this for exploratory data — financial transactions, log streams, audit trails.
- Both are
<BcServerGrid rowModel="…">. SwitchrowModelat runtime — bc-grid handles the mode polymorphism.
The contract
- loadBlock(query, ctx). Receives
{ blockStart, blockSize, view }. Returns{ rows, blockStart, blockSize, totalRows?, hasMore? }. Honourctx.signalfor cancellation. - LRU cache. The grid caps cached blocks (default ~10 blocks ahead and behind the viewport). Tune via
cacheLimitandprefetchAhead. - Auto-retry. On block failure, the grid retries with exponential backoff (1s, 2s, 4s). Override with
autoRetryBlocksoronBlockError.