Home/Data & State/Infinite Scroll
Data & State

Infinite Scroll

Connect a real HTTP backend. The grid fetches the next batch of rows as you scroll down. Each request carries your active sorts and filters, so the results always reflect the current view.

#
First Name
Last Name
Email
Department
Salary ($)
Status
1
Alice
Smith
alice.smith0@acme.com
Engineering
40000
Inactive
2
Bob
Smith
bob.smith1@acme.com
Marketing
41000
Active
3
Carol
Smith
carol.smith2@acme.com
Sales
42000
Active
4
David
Smith
david.smith3@acme.com
HR
43000
Active
5
Emma
Smith
emma.smith4@acme.com
Finance
44000
Active
6
Frank
Smith
frank.smith5@acme.com
Operations
45000
Active
7
Grace
Smith
grace.smith6@acme.com
Design
46000
Active
8
Henry
Smith
henry.smith7@acme.com
Legal
47000
Inactive
9
Iris
Smith
iris.smith8@acme.com
Product
48000
Active
10
Jack
Smith
jack.smith9@acme.com
Support
49000
Active
11
Kate
Smith
kate.smith10@acme.com
Engineering
50000
Active
12
Liam
Smith
liam.smith11@acme.com
Marketing
51000
Active
13
Mia
Smith
mia.smith12@acme.com
Sales
52000
Active
14
Noah
Smith
noah.smith13@acme.com
HR
53000
Active
15
Olivia
Smith
olivia.smith14@acme.com
Finance
54000
Inactive
16
Paul
Smith
paul.smith15@acme.com
Operations
55000
Active
17
Quinn
Smith
quinn.smith16@acme.com
Design
56000
Active
18
Rachel
Smith
rachel.smith17@acme.com
Legal
57000
Active
19
Sam
Smith
sam.smith18@acme.com
Product
58000
Active
20
Tara
Smith
tara.smith19@acme.com
Support
59000
Active
20 / 500 records

How infinite scroll works

With scrollMode: 'infinite', the grid fetches the first batch on load and listens for scroll events. When the user approaches the bottom of the loaded content, it fires another fetchRows() call with the next offset and the same limit. Rows accumulate — they're appended, never replaced. The process stops when the loaded count reaches totalCount, at which point the grid shows the messages.allLoaded string.

Key config options

  • scrollMode: 'infinite' — activates this mode. The grid renders a fixed-height viewport with an inner virtual scroll container.
  • pageSize — the limit value sent in every fetchRows() call. Tune this to match your API's optimal page size — smaller values mean more round-trips, larger values mean slower initial paint. Default: 50.
  • filterMode: 'row' — renders a persistent filter input row below the column headers. A filter change resets the grid and calls fetchRows() from offset 0.
  • messages.allLoaded — text shown at the bottom when all rows are loaded. Customize it to match your data noun: 'All 500 employees loaded'.
  • messages.empty / messages.error — shown when no rows match or the fetch fails. A Retry button appears with the error state automatically.

What FetchParams contains

On each call, the grid provides offset (rows to skip), limit (rows to return), sorts: SortConfig[], and filters: FilterState. Serialize what your API understands and discard the rest. Sort and filter changes always reset offset to 0 — the grid never pages forward into a different filter state.

Error handling

If fetchRows() returns an error Observable, the grid shows the error state with a Retry button. The retry call reuses the same offset, so the user doesn't lose their scroll position. Catch and rethrow in your data source if you need to log or transform the error first.

Choosing between scroll modes

Infinite scroll suits browsing flows where users read top-to-bottom and want seamless continuity. Use paging when users need to navigate to a specific page number.

A failed fetch shows the error state with a Retry button, and the retry reuses the same offset — the user never loses their scroll position.

Infinite scroll options

PropertyTypeDefaultDescription
config.scrollMode: 'infinite'ScrollMode'infinite'Appends the next batch when the user nears the bottom — rows accumulate, never replaced.
config.pageSizenumber50The limit sent in every fetchRows() call.
config.filterMode: 'row''row' | 'popup'—Persistent filter inputs under the headers (popup puts them behind header icons); a change resets to offset 0 and refetches.
config.messages.allLoadedstring'All records loaded'Shown at the bottom once the loaded count reaches totalCount.
config.messages.empty / errorstring—Empty and error states — the error state renders a Retry button automatically.
params.sorts / params.filtersSortConfig[] / FilterState—Serialize what your API understands; sort/filter changes always reset offset to 0.