WarUI documentation

Remote data source contract

experimental

Load rows by index window from a simulated server without holding the full dataset.

Live example

Expected behavior

On mount one request covers the viewport plus buffer. Scrolling to an unloaded region requests only that range, and the log shows each range and its time to resolve.

Source

const api = createGrid({
  rows: [],
  columns,
  rowModel: 'remote',
  remoteSource: {
    async fetchWindow({ startIndex, endIndex, signal }) {
      const res = await fetch(`/orders?from=${startIndex}&to=${endIndex}`, { signal });
      const { rows, total } = await res.json();
      return { rows, totalCount: total };
    },
  },
});
api.requestWindow(0, 20);

API reference

GRID-A04-F01 API
KindNameTypeDescription
OptionrowModel—Set to 'remote' to load rows through remoteSource.
MethodremoteSource.fetchWindow—Receives startIndex (inclusive), endIndex (exclusive) and requestId, and resolves rows and an optional totalCount.
MethodrequestWindow—Fetches only the uncached, not in-flight rows of a range.
EventremoteWindowLoaded—Reports the range, row count and known total.
EventremoteWindowFailed—Reports the range and the error of a failed request.