IDataTableSelectStrategy

interface
Component Props

Strategy object that controls how rows are selected in a DataTable — defines whether a select-all checkbox is shown and implements the select / selectAll / allSelected algorithms.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

showSelectAll
required
boolean
Whether a select-all checkbox should be rendered in the header row.
allSelected
required
(data: { allItems: Array<IDataTableSelectableItem> currentPage: Array<IDataTableSelectableItem> }) => Array<IDataTableSelectableItem>
Returns the subset of items that are considered fully selected under this strategy.
select
required
(data: { items: Array<IDataTableSelectableItem> value: boolean selected: Set<unknown> }) => Set<unknown>
Applies a selection toggle on a given set of items and returns the new selected set.
selectAll
required
(data: { value: boolean allItems: Array<IDataTableSelectableItem> currentPage: Array<IDataTableSelectableItem> selected: Set<unknown> }) => Set<unknown>
Applies a select-all or deselect-all operation and returns the resulting selected set.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Custom page-only select strategy

typescript