GroupingRow
Module Extensions
Section titled “Module Extensions”HTMLRevoGridElementEventMap (Extended from global)
Section titled “HTMLRevoGridElementEventMap (Extended from global)”grid.addEventListener(GROUP_EXPAND_EVENT, (e: OnExpandEvent) => { console.log(e) })
interface HTMLRevoGridElementEventMap { [GROUP_EXPAND_EVENT]: OnExpandEvent}Plugin API
Section titled “Plugin API”GROUP_DEPTH
Section titled “GROUP_DEPTH”GROUP_DEPTH: string;PSEUDO_GROUP_ITEM
Section titled “PSEUDO_GROUP_ITEM”PSEUDO_GROUP_ITEM: string;PSEUDO_GROUP_ITEM_ID
Section titled “PSEUDO_GROUP_ITEM_ID”PSEUDO_GROUP_ITEM_ID: string;PSEUDO_GROUP_ITEM_VALUE
Section titled “PSEUDO_GROUP_ITEM_VALUE”PSEUDO_GROUP_ITEM_VALUE: string;PSEUDO_GROUP_COLUMN
Section titled “PSEUDO_GROUP_COLUMN”PSEUDO_GROUP_COLUMN: string;GROUP_EXPANDED
Section titled “GROUP_EXPANDED”GROUP_EXPANDED: string;GROUP_COLUMN_PROP
Section titled “GROUP_COLUMN_PROP”GROUP_COLUMN_PROP: string;GROUP_ORIGINAL_INDEX
Section titled “GROUP_ORIGINAL_INDEX”GROUP_ORIGINAL_INDEX: string;GROUP_EXPAND_BTN
Section titled “GROUP_EXPAND_BTN”GROUP_EXPAND_BTN: string;GROUP_EXPAND_EVENT
Section titled “GROUP_EXPAND_EVENT”GROUP_EXPAND_EVENT: string;GROUPING_ROW_TYPE
Section titled “GROUPING_ROW_TYPE”GROUPING_ROW_TYPE: DimensionRows;doCollapse
Section titled “doCollapse”export declare function doCollapse(pIndex: number, source: DataType[]): { trimmed: Record<number, boolean>;};;doExpand
Section titled “doExpand”@param pIndex - physical index
@param vIndex - virtual index, need to update item collection
@param source - data source
@param rowItemsIndexes - rgRow indexes
export declare function doExpand(vIndex: number, source: DataType[], rowItemsIndexes: number[]): { trimmed: Record<number, boolean>; items?: number[];};;GroupingRowPlugin
Section titled “GroupingRowPlugin”class GroupingRowPlugin { getStore(type?: DimensionRows): Observable<DSourceState<DataType, DimensionRows>>;;
/** * External call to apply grouping. Called by revogrid when prop changed. */ setGrouping(options: GroupingOptions): void;;
clearGrouping(): void;;}RowGroupingProps (Extended from grouping.row.plugin.d.ts)
Section titled “RowGroupingProps (Extended from grouping.row.plugin.d.ts)”export type RowGroupingProps = GroupRowPros & PositionItem & { /** * Visible columns in the grid, can be used to get the width of the column and position of the column * to calculate the position of the cells in the grouping row */ columnItems: VirtualPositionItem[];};GroupRowPros (Extended from grouping.row.plugin.d.ts)
Section titled “GroupRowPros (Extended from grouping.row.plugin.d.ts)”interface GroupRowPros { model: DataType; hasExpand: boolean; providers: Providers; groupingCustomRenderer?: GroupLabelTemplateFunc | null; groupingCellRenderer?: GroupCellTemplateFunc | null; additionalData?: any}GroupLabelTemplateFunc
Section titled “GroupLabelTemplateFunc”export type GroupLabelTemplateFunc = (createElement: HyperFunc<VNode>, props: GroupTemplateProp & RowGroupingProps, ...args: any[]) => any;GroupCellTemplateProp (Extended from grouping.row.plugin.d.ts)
Section titled “GroupCellTemplateProp (Extended from grouping.row.plugin.d.ts)”interface GroupCellTemplateProp { /** * Column viewport type that owns the cell. */ colType: DimensionCols | 'rowHeaders'; /** * Current virtual column position. Only columns rendered by the viewport are * passed to the group cell template. */ columnItem: VirtualPositionItem; /** * Current virtual row position. */ rowItem: VirtualPositionItem; /** * Semantic information about the synthetic group row. */ group: { name: string; depth: number; expanded: boolean; prop: ColumnProp; isLabelColumn: boolean; canExpand: boolean; onExpand(event: MouseEvent): void; }}GroupCellTemplateFunc
Section titled “GroupCellTemplateFunc”export type GroupCellTemplateFunc = (createElement: HyperFunc<VNode>, props: GroupCellTemplateProp, additionalData?: any) => any;GroupingOptions (Extended from grouping.row.plugin.d.ts)
Section titled “GroupingOptions (Extended from grouping.row.plugin.d.ts)”export type GroupingOptions = { /** * Column props to which grouping will be applied */ props?: ColumnProp[]; /** * Should grouping be preserved on source update. * default: true */ preserveGroupingOnUpdate?: boolean; /** * Custom group label template */ groupLabelTemplate?: GroupLabelTemplateFunc; /** * Custom template for cells in synthetic group rows. * When provided, group rows render only the columns in the current horizontal * viewport and this template takes precedence over `groupLabelTemplate`. */ groupCellTemplate?: GroupCellTemplateFunc;} & ExpandedOptions;BeforeSourceSetEvent
Section titled “BeforeSourceSetEvent”export type BeforeSourceSetEvent = { type: DimensionRows; source: DataType[];};OnExpandEvent
Section titled “OnExpandEvent”export type OnExpandEvent = { model: DataType; virtualIndex: number;};ExpandedOptions
Section titled “ExpandedOptions”export type ExpandedOptions = { /** * Currently expanded items. to set expanded: '{ 'a': true, 'a,b': true, 'a,b,c': true }' */ prevExpanded?: Record<string, boolean>; /** * Is expanded by default */ expandedAll?: boolean; /** * Custom group label value parser */ getGroupValue?(item: DataType, prop: string | number): any; /** * Replacement group value for `null` and `undefined` keys. * Used by the default group value resolver. * @default '' */ emptyGroupValue?: any; /** * Custom group label template */ groupLabelTemplate?: GroupLabelTemplateFunc; /** * Custom template for virtualized cells in synthetic group rows. */ groupCellTemplate?: GroupCellTemplateFunc;};getSource
Section titled “getSource”export declare function getSource(source: DataType[], items: number[], withoutGrouping?: boolean): Required<SourceGather>;;getExpanded
Section titled “getExpanded”export declare function getExpanded(model?: DataType): any;;gatherGrouping
Section titled “gatherGrouping”Gather data for grouping
@param array - flat data array
@param columnProps - ids of groups
@param expanded - potentially expanded items if present
export declare function gatherGrouping(array: DataType[], columnProps: ColumnProp[], { prevExpanded, expandedAll, getGroupValue, emptyGroupValue, }: ExpandedOptions): { sourceWithGroups: DataType[]; depth: number; trimmed: Record<number, boolean>; oldNewIndexMap: Record<number, number>;};;getGroupingName
Section titled “getGroupingName”export declare function getGroupingName(rgRow?: DataType): any;;isGrouping
Section titled “isGrouping”export declare function isGrouping(rgRow?: DataType): rgRow is GroupingItem;;isGroupingColumn
Section titled “isGroupingColumn”export declare function isGroupingColumn(column?: ColumnRegular): boolean;;measureEqualDepth
Section titled “measureEqualDepth”export declare function measureEqualDepth<T>(groupA: T[], groupB: T[]): number;;getParsedGroup
Section titled “getParsedGroup”export declare function getParsedGroup(id: string): any[] | null;;isSameGroup
Section titled “isSameGroup”export declare function isSameGroup(currentGroup: any[], currentModel: DataType, nextModel: DataType): boolean;;expandEvent
Section titled “expandEvent”export declare function expandEvent(e: MouseEvent, model: DataType, virtualIndex: number): void;;renderGroupCells
Section titled “renderGroupCells”export declare function renderGroupCells(props: RowGroupingProps, { name, expanded, depth, }: { name: string; expanded: boolean; depth: number;}): VNodeResponse[];;GroupingRowRenderer
Section titled “GroupingRowRenderer”GroupingRowRenderer: (props: RowGroupingProps) => any;expandSvgIconVNode
Section titled “expandSvgIconVNode”expandSvgIconVNode: (expanded?: boolean | undefined) => any;default
Section titled “default”GroupingRowRenderer: (props: RowGroupingProps) => any;