IDataTableProvideGroup

interface
Component Props

Internal provide/inject contract for row-grouping state in <OrigamDataTable> — exposes the groupBy axis, the open/closed set of group nodes and helpers to toggle, extract and query groups.

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.

sortByWithGroups
required
ComputedRef<Array<IDataTableSortItem>>
Computed sort array that prepends the groupBy columns so groups are contiguous before any user-defined sort keys.
toggleGroup
required
(group: IDataTableGroup) => void
Toggles the open/closed state of a group node.
opened
required
Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>
Reactive set of group IDs that are currently open (expanded).
groupBy
required
Ref<Array<IDataTableSortItem>>
Reactive array of column keys used as the grouping axis.
extractRows
required
(items: Array<IDataTableGroupableItem | IDataTableGroup<IDataTableGroupableItem>>) => Array<IDataTableGroupableItem>
Flattens a mixed array of items and group nodes into a plain array of leaf items.
isGroupOpen
required
(group: IDataTableGroup) => boolean
Returns true when the given group is currently expanded.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Grouping rows by a column

vue