gridcn1.2.2

Streaming

A live ticker feed pushing updateCells batches four times a second (deferred vs immediate re-sort).

A live ticker: updateCells streams new values in place, four batches per second. The Auto-sort switch picks how the display reacts. reorder: "immediate" re-sorts every tick, reorder: "defer" lets the values land and shows a Re-sort bar when the display order goes stale.

Click the Change % header to sort: with Auto-sort off, rows hold their position as new values stream in and a "Re-sort" bar appears once the order goes stale; with Auto-sort on, the grid re-sorts on every tick (4/s).

Symbol
Price
Change %
Volume
AAPL
100
0
1000000
MSFT
117.5
0
1025000
NVDA
135
0
1050000
AMZN
152.5
0
1075000
GOOG
170
0
1100000
META
187.5
0
1125000
TSLA
205
0
1150000
AMD
222.5
0
1175000
INTC
240
0
1200000
NFLX
257.5
0
1225000
pnpm dlx shadcn@latest add @gridcn/data-grid-streaming-demo

What's in the demo

  • A ticker feed pushing change/volume patches for every row every 250 ms
  • Auto-sort on: the grid re-sorts by the sorted column on every batch (watch the rows shuffle as prices cross each other)
  • Auto-sort off: rows hold their position. When a deferred batch changed the sort order, a Re-sort bar appears, and reconcileView() applies it in one step

Behavior reference

On this page