Same Value Merge
Module Extensions
Section titled “Module Extensions”ColumnRegular (Extended from @revolist/revogrid)
Section titled “ColumnRegular (Extended from @revolist/revogrid)”interface ColumnRegular { /** * Enables same-value merging for this column */ merge?: boolean}Plugin API
Section titled “Plugin API”SameValueMergePlugin
Section titled “SameValueMergePlugin”The SameValueMergePlugin is a RevoGrid plugin designed to merge cells with the same values in a column.
It adds visual merge markers to cells that have the same value as the nearest comparable visible row
above or below them.
Key Features:
- Visible row comparison: Checks nearest comparable visible rows above and below the current cell
- Grouping support: Group rows are comparable when they carry the current column value
- Column Configuration: Supports a ‘merge’ property on columns to enable/disable merging
- Visual Styling: Adds an
auto-mergemarker used by CSS to hide repeated values
Usage:
- This plugin should be included in the grid’s plugin array to enable same-value merging functionality.
- Configure columns with the ‘merge’ property to enable merging for specific columns.
Example
Section titled “Example”import { SameValueMergePlugin } from './same-value-merge-plugin';
const grid = document.createElement('revo-grid');grid.plugins = [SameValueMergePlugin]; // Add merge plugingrid.columns = [ { prop: 'name', name: 'Name' }, { prop: 'category', name: 'Category', merge: true }, // Enable merging for this column];class SameValueMergePlugin { destroy(): void;}isPivotGeneratedRow
Section titled “isPivotGeneratedRow”export function isPivotGeneratedRow(model?: DataType);isPivotTotalRow
Section titled “isPivotTotalRow”export function isPivotTotalRow(model?: DataType);hasPivotMergeBoundary
Section titled “hasPivotMergeBoundary”export function hasPivotMergeBoundary( items: number[], visibleIndex: number, source: DataType[], currentModel: DataType | undefined, prop: ColumnProp,);