RowExpansionFeature
Defined in: core/features/row-expanding.svelte.ts:42
Manages row expansion functionality within the data grid. Allows expanding and collapsing rows, with the state tracked via expanded row IDs.
Type Parameters
• TOriginalRow = any
The type of the original row data in the grid.
Implements
Constructors
new RowExpansionFeature()
new RowExpansionFeature<
TOriginalRow
>(datagrid
,config
?):RowExpansionFeature
<TOriginalRow
>
Defined in: core/features/row-expanding.svelte.ts:61
Creates an instance of the RowExpansionFeature.
Parameters
datagrid
DatagridCore
<TOriginalRow
>
The data grid instance.
config?
Partial
Optional configuration to initialize the state.
Returns
RowExpansionFeature
<TOriginalRow
>
Properties
Property | Type | Description | Defined in |
---|---|---|---|
datagrid | DatagridCore <TOriginalRow > | The data grid instance this feature belongs to | core/features/row-expanding.svelte.ts:44 |
expandedRowIds | SvelteSet <GridRowIdentifier > | Set containing the IDs of currently expanded rows | core/features/row-expanding.svelte.ts:47 |
expansionMode | RowExpansionMode | The current row expansion mode (‘single’ or ‘multiple’) | core/features/row-expanding.svelte.ts:50 |
maxExpandedRows | number | The maximum number of rows that can be expanded at the same time | core/features/row-expanding.svelte.ts:53 |
Methods
collapseRow()
collapseRow(
identifier
):void
Defined in: core/features/row-expanding.svelte.ts:89
Collapses a specific row by its identifier.
Parameters
identifier
The identifier of the row to collapse. Emits ‘onRowCollapse’ and removes the row from the expanded rows set.
Returns
void
expandRow()
expandRow(
identifier
):void
Defined in: core/features/row-expanding.svelte.ts:73
Expands a specific row by its identifier.
Parameters
identifier
The identifier of the row to expand. Emits ‘onRowExpand’ and adds the row to the expanded rows set. If the expansion limit is reached, an event ‘onRowExpansionLimitExceeded’ is emitted.
Returns
void
isRowExpanded()
isRowExpanded(
rowId
):boolean
Defined in: core/features/row-expanding.svelte.ts:114
Checks if a specific row is currently expanded.
Parameters
rowId
The identifier of the row to check.
Returns
boolean
True if the row is expanded, otherwise false.
toggleRowExpansion()
toggleRowExpansion(
identifier
):void
Defined in: core/features/row-expanding.svelte.ts:100
Toggles the expansion state of a specific row. If the row is expanded, it will be collapsed. If it is collapsed, it will be expanded.
Parameters
identifier
The identifier of the row to toggle.
Returns
void