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.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- sortByWithGroupsrequiredComputedRef<Array<IDataTableSortItem>>
- Computed sort array that prepends the groupBy columns so groups are contiguous before any user-defined sort keys.
- toggleGrouprequired(group: IDataTableGroup) => void
- Toggles the open/closed state of a group node.
- openedrequiredRef<Set<string> & Omit<Set<string>, keyof Set<any>>>
- Reactive set of group IDs that are currently open (expanded).
- groupByrequiredRef<Array<IDataTableSortItem>>
- Reactive array of column keys used as the grouping axis.
- extractRowsrequired(items: Array<IDataTableGroupableItem | IDataTableGroup<IDataTableGroupableItem>>) => Array<IDataTableGroupableItem>
- Flattens a mixed array of items and group nodes into a plain array of leaf items.
- isGroupOpenrequired(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