Skip to content

Multi Range Selection

HTMLRevoGridElement (Extended from global)

Section titled “HTMLRevoGridElement (Extended from global)”
interface HTMLRevoGridElement {
getMultiRangeSelectedRanges?: () => MultiRangeSelectionRange[];
setMultiRangeSelectedRanges?: (
ranges: MultiRangeSelectionRange[],
activeIndex?: number,
) => void;
clearMultiRangeSelectedRanges?: () => void
}

HTMLRevoGridElementEventMap (Extended from global)

Section titled “HTMLRevoGridElementEventMap (Extended from global)”
interface HTMLRevoGridElementEventMap {
multirangeselectionchange: MultiRangeSelectionChangeEvent
}
export type MultiRangeSelectionChangeEvent = {
ranges: MultiRangeSelectionRange[];
inactiveRanges: MultiRangeSelectionRange[];
activeRange: MultiRangeSelectionRange | null;
activeIndex: number;
};

export type MultiRangeSelectionRange = {
rowType: DimensionRows;
colType: DimensionCols;
range: RangeArea;
};

export function buildMultiRangeClipboardData(
ranges: MultiRangeSelectionRange[],
providers: PluginProviders,
options: MultiRangeClipboardOptions =;

MULTI_RANGE_CLIPBOARD_MIME: string;

export type MultiRangeClipboardData = {
text: string;
html: string;
mode: 'sparse' | 'blocks';
payload?: MultiRangeClipboardPayload;
};

export type MultiRangeClipboardPayload = {
width: number;
height: number;
cells: MultiRangeClipboardCell[];
};

export type MultiRangeClipboardOptions = {
maxSparseCells?: number;
maxSparseExpansion?: number;
preserveSparseGaps?: boolean;
serializeValue?: (value: unknown) => string;
};

export function normalizeMultiTablePasteData(;

export function buildMultiRangeClearEdits(
ranges: MultiRangeSelectionRange[],
providers: PluginProviders,
value: DataFormat = '',
): BeforeRangeSaveDataDetails[] | null;

Clipboard companion for {@link MultiRangeSelectionPlugin}.

Keeps multi-range copy and paste behavior separate from selection state: it serializes all selected ranges and normalizes RevoGrid multi-table HTML paste back to the complete text payload.

  • Event integration CLIPBOARD_COPY_EVENT, CLIPBOARD_PASTE_EVENT: Listens to RevoGrid clipboard events to copy and paste multi-range selections.
  • Event integration json-clipboard: Cooperates with ClipboardJsonPlugin when JSON clipboard serialization is enabled.
class MultiRangeClipboardPlugin {}

Enables spreadsheet-like multi-range cell selection in RevoGrid Pro.

Ctrl/Cmd+click stores the current active range and starts a new active range. Shift interactions keep extending the active core range. Additional inactive ranges are rendered by this plugin and included in multi-range copy output.

  • Auto-installed MultiRangeClipboardPlugin: Installs MultiRangeClipboardPlugin internally for multi-range copy and paste behavior.
  • Event integration MultiRangeClipboardPlugin: Delegates multi-range clipboard serialization and paste normalization to MultiRangeClipboardPlugin.
class MultiRangeSelectionPlugin {
getSelectedRanges(): MultiRangeSelectionRange[];
setSelectedRanges(
ranges: MultiRangeSelectionRange[],
activeIndex = ranges.length - 1,
);
clearSelectedRanges();
destroy();
}

export function normalizeRange(range: RangeArea): RangeArea;

export function cloneRange(range: RangeArea): RangeArea;

export function normalizeSelectionRange(
selection: MultiRangeSelectionRange,
): MultiRangeSelectionRange;

export function cloneSelectionRange(
selection: MultiRangeSelectionRange,
): MultiRangeSelectionRange;

export function rangeKey(selection: MultiRangeSelectionRange);

export function dedupeRanges(
ranges: MultiRangeSelectionRange[],
): MultiRangeSelectionRange[];

export function sortRanges(
ranges: MultiRangeSelectionRange[],
): MultiRangeSelectionRange[];

export function isCellInRange(cell: Cell, range: RangeArea);

export function findRangeForCell(
cell: MultiRangeSelectionCell,
ranges: MultiRangeSelectionRange[],
);

export function rangeCellCount(range: RangeArea);

export function isSingleCellRange(range: RangeArea);

export function getRangeBounds(ranges: MultiRangeSelectionRange[]): RangeArea | null;

export function groupRangesByDimension(ranges: MultiRangeSelectionRange[]);

export function getInactiveRangeCellClasses(
cell: MultiRangeSelectionCell,
selection: MultiRangeSelectionRange,
);

export function moveCellWithinRange(
range: RangeArea,
focus: Cell,
key: string,
backwards = false,
): Cell | null;

MULTI_RANGE_SELECTION_GRID_CLASS: string;

MULTI_RANGE_SELECTION_CELL_CLASS: string;

MULTI_RANGE_SELECTION_ATTR: string;

MULTI_RANGE_SELECTION_EDGE_TOP_CLASS: string;

MULTI_RANGE_SELECTION_EDGE_RIGHT_CLASS: string;

MULTI_RANGE_SELECTION_EDGE_BOTTOM_CLASS: string;

MULTI_RANGE_SELECTION_EDGE_LEFT_CLASS: string;

export type MultiRangeClipboardCell = {
row: number;
col: number;
value: unknown;
};

export type MultiRangeSelectionCell = {
row: number;
col: number;
rowType: DimensionRows;
colType: DimensionCols;
};