WarUI

Programmatic pagination API and events

GRID-A19-F05P0baselinePlanned

Exposes methods and events to read and control pagination from application code. External toolbars, deep links and analytics can then use the same state the built-in pager shows.

Planned. This page shows the specification from issue #199. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

Built-in pager hidden. An external custom toolbar is shown with buttons wired to the API, plus an event log.

Expected behavior

External buttons move the grid between pages. The event log lists each change with its source ('api' or 'ui'). getState returns pageIndex, pageSize, totalRows and totalPages.

Planned API surface

api.pagination.getStateapi.pagination.goToPageapi.pagination.nextapi.pagination.previousapi.pagination.setPageSizeonPageChangeonPaginationStateChange

Acceptance criteria

  • goToPage(n) navigates to the zero-based page index n and clamps out-of-range values (pending)
  • Events include previous state, next state and a source field (pending)
  • Calls that leave the state unchanged emit no event (pending)
  • The state object is immutable from the caller's side (pending)