Data Grid API
Complete API reference for @oge-ui/grid — inputs, two-way models, imperative methods, the full event surface and the supporting types, compiled from the source TSDoc. Feature guides live on the demo pages.
Properties Methods Events Types
OgeGrid
oge-gridProperties 56
Data & columns
| Name | Type | Default | Description |
|---|---|---|---|
data | readonly T[] | DataSource<T> | [] | Rows to render: a static array or any DataSource implementation (remote, OData…). |
columns | readonly (string | OgeColumnDef<T>)[] | undefined | — | Programmatic columns: field names or OgeColumnDef objects carrying every <oge-column> option (templates as TemplateRefs). The way to share columns through a wrapper component — Angular content queries never see columns projected through another component. Used only when no declarative children exist; when both are absent, columns derive from the first row. |
keyField | keyof T | ((row: T) => RowKey) | undefined | — | Field (or selector) producing a stable row key; falls back to the row index. |
Sorting, filtering & search
| Name | Type | Default | Description |
|---|---|---|---|
sortable | boolean | 'single' | 'multi' | 'multi' | false disables sorting; 'single' restricts to one column. |
sorting | OgeSortingOptions | undefined | — | Sorting options; overrides the sortable shorthand. |
filterRow | boolean | OgeFilterRowOptions | false | Per-column filter editors below the header. |
headerFilter | boolean | OgeHeaderFilterOptions | false | Excel-style distinct-value filter button in headers. |
searchPanel | boolean | OgeSearchPanelOptions | false | Global search box above the grid. |
filterPanel | boolean | false | Filter panel bar with the filter-builder entry point. |
filterValue | model<FilterExpr | null> | null | Two-way binding of the builder/programmatic filter expression. |
filterDebounce | number | undefined | — | Debounce for text filter inputs, in ms. Set to 0 in tests. |
announcements | boolean | undefined | config.announcements (true) | Speaks sort, filter/search result count (debounced, once the new result arrived), page, group expansion, select-all and blocked-save validation changes through the shared OgeLiveAnnouncer regions — texts from the *Announcement messages. false opts out. |
Paging & scrolling
| Name | Type | Default | Description |
|---|---|---|---|
paging | false | OgePagingOptions | false | Client/server paging with the built-in pager. |
virtualScroll | boolean | false | Renders only the rows inside the scroll viewport (plus overscan). Needs a bounded height. |
scrolling | OgeScrollingOptions | undefined | — | Scrolling options (standard/virtual/infinite, remote windowing, column virtualization); overrides the shorthand. |
rowHeight | number | undefined | — | Fixed row height in px used by the virtualizer. Defaults from global config. |
autoRowHeight | boolean | false | Measures real row heights with scroll anchoring. Virtual mode only. |
detailRowHeight | number | undefined | — | Height assumed for expanded master-detail rows in virtual mode. |
overscan | number | undefined | — | Extra rows rendered above/below the virtual window. |
Grouping
| Name | Type | Default | Description |
|---|---|---|---|
groupPanel | boolean | false | Drop area for drag-and-drop row grouping. Keyboard: the header context menu (Shift+F10) offers groupByColumn / ungroupColumn; on a chip’s remove button Ctrl+←/→ reorders the grouping and Delete removes it (messages.groupMoved / groupRemoved). |
groupBy | readonly string[] | undefined | — | Initial/programmatic grouping by field names. |
grouping | OgeGroupingOptions | undefined | — | autoExpandAll: false starts collapsed and enables deferred child loading; contextMenuEnabled: true offers group/ungroup in the header menu without the group panel. |
Selection & focus
| Name | Type | Default | Description |
|---|---|---|---|
selectionMode | OgeSelectionMode | 'none' | Row selection: none | single | multiple (ctrl/shift) | checkbox column — or 'cell': rectangular cell ranges (click, Shift+click, drag, Shift+Arrow, Ctrl+click for more ranges, Ctrl+A for all) with TSV copy / paste, the fill handle and range announcements; editing then starts on double-click, F2 or Enter. |
selectedKeys | model<RowKey[]> | [] | Two-way binding of the selected row keys. |
selectAllMode | 'allPages' | 'page' | 'allPages' | Header select-all scope. |
selectionDeferred | boolean | false | Selection tracked as a serializable selectionFilter expression — no key set. Requires a string keyField. |
selectionFilter | model<FilterExpr | null> | null | Two-way selection expression (deferred mode). |
focusedRowEnabled | boolean | false | Highlights and tracks a single focused row. |
focusedRowKey | model<RowKey | null> | null | Two-way binding of the focused row's key. |
Editing & rows
| Name | Type | Default | Description |
|---|---|---|---|
editing | false | OgeEditingOptions | false | Enables editing: { mode: 'cell' | 'row' | 'batch' | 'popup' | 'form', allow… }. An invalid cell editor sets aria-invalid on its control and points aria-errormessage / aria-describedby at a rendered, visually hidden error text (also the cell’s tooltip); the form/popup fields wire the same through <oge-form>. |
commandButtons | readonly OgeCommandButton<T>[] | undefined | — | Customizes the trailing command column: built-in 'edit'/'delete' plus custom buttons with per-row visible. |
rowDragging | boolean | false | Drag-handle column for reordering rows. Arrays mutate in place; DataSources handle rowReordered. Keyboard: Ctrl+↑/↓ on a focused cell moves the row onto its neighbour through the same drop path (same event), announced via messages.rowMoved. |
Columns UX
| Name | Type | Default | Description |
|---|---|---|---|
columnChooser | boolean | false | Column visibility chooser button. Keyboard: Space toggles an item; with columnReorder, Ctrl+↑/↓ moves it. Hiding is also in the header context menu. |
columnResize | boolean | true | Drag-resize handles on header edges. Keyboard: Alt+←/→ on a focused header resizes by 10px (Shift for 1px); the handle is a focusable role="separator" (aria-valuenow/min/max = width in px, named by messages.resizeColumn) taking ←/→, Home/End (min / max) and Enter/Esc (back to the header). RTL-aware; clamped to minWidth / maxWidth. |
columnReorder | boolean | true | Drag-and-drop column reordering. Keyboard: Ctrl+Shift+←/→ on a focused header moves the column one step, never across a pinned group or out of its band (an unbanded column steps over a band as a whole), announced via messages.columnMoved. |
columnMinWidth | number | undefined | — | Track minimum for columns without an explicit width. |
columnHidingMode | 'hide' | 'detail' | undefined | config: 'detail' | What happens to columns responsive hiding (hidingPriority) takes out on a narrow grid: 'detail' gives every row a toggle (a real button with aria-expanded / aria-controls, labelled by toggleAdaptiveDetail) that reveals the hidden columns' caption / value pairs on a second line of the row, rendered like the cells — format, lookups, boolean words and cell templates; 'hide' drops them with no way back. The hiding pass counts the toggle's 32px track once a column is hidden. |
Appearance & misc
| Name | Type | Default | Description |
|---|---|---|---|
stateKey | string | undefined | — | Persists user state (sort, filters, grouping, layout) via OGE_STATE_STORAGE. |
messages | Partial<OgeGridMessages> | undefined | — | Per-grid overrides of the UI strings. |
loadPanel | boolean | false | Spinner overlay while a load is in flight. |
wordWrap | boolean | false | Cells wrap instead of truncating. |
rowAlternation | boolean | false | Zebra striping, stable under virtualization. |
highlightChanges | boolean | false | Briefly flashes cells patched by push updates. |
rtlEnabled | boolean | undefined | — | undefined auto-detects the inherited CSS direction. |
Cells, ranges & clipboard
| Name | Type | Default | Description |
|---|---|---|---|
rangeSelection | OgeRangeSelectionOptions | undefined | — | { copyHeaders, fillHandle, pasteAddsRows, multipleRanges }: Ctrl+C prepends the captions; the fill handle (on by default while editing) can be turned off; pasted lines past the last row become new rows; Ctrl+click may add ranges (default true). |
selectedRanges | model<readonly OgeGridCellRange[]> | [] | Two-way binding of the selected ranges ({ anchor, focus } in flat-row / visible-column coordinates). A sort, filter, page or grouping change clears them. |
pinnedTopRows | readonly (T | RowKey)[] | undefined | — | Rows pinned in a sticky section under the header: data objects, or keys of loaded rows (which then leave the body). Display rows — not editable, selectable or part of arrow-key navigation; virtual scrolling compatible. |
pinnedBottomRows | readonly (T | RowKey)[] | undefined | — | Rows pinned in the sticky footer, above the total row. |
stickyGroupRows | boolean | false | Keeps the group rows enclosing the first visible row under the header while scrolling (all levels, virtual scrolling included). A visual aid: the real group rows stay focusable; a click on a sticky row scrolls to it. |
cellSpan | ((row: T, column: OgeGridColumnInfo) => OgeGridCellSpan | null | undefined) | undefined | — | Row / column spans per cell ({ rowSpan, colSpan }). Spans never cross group rows; the owner cell gets aria-rowspan / aria-colspan and the arrows step over the covered area. Ignored while virtualized; row spans assume uniform row heights. |
columnAutoWidth | boolean | false | Sizes every column to its header and rendered cells once the first result set rendered. |
cellHintEnabled | boolean | false | Shows truncated cell text in the overlay tooltip on hover and immediately on keyboard focus (aria-describedby while shown). |
Styling & drag groups
| Name | Type | Default | Description |
|---|---|---|---|
rowClass | ((row: T, key: RowKey) => OgeClassValue) | undefined | — | Classes for a data row — a string, an array or a { class: condition } record. |
cellClass | ((row: T, column: OgeGridColumnInfo) => OgeClassValue) | undefined | — | Classes for a data cell, per row and column ({ field, caption, dataType, index }). |
rowDragGroup | string | undefined | — | Grids (and other components) sharing a group name accept each other’s dragged rows; the target fires rowDrop with the source row — move the data in the handler. The source needs rowDragging. |
allowDropInsideRow | boolean | false | A drop on the middle half of a row reports position: 'inside' (and moves nothing by itself) instead of before / after. |
Methods 39
Data & view
| Name | Type | Description |
|---|---|---|
refresh(): void | void | Re-runs the current load against the DataSource. |
getVisibleRows(): readonly T[] | readonly T[] | Data rows of the currently rendered page, in display order. |
getRowByKey(key: RowKey): T | undefined | T | undefined | The loaded row carrying key, if currently rendered. |
totalCount(): number | Signal<number> | Data row count of the current filtered set, across all pages. |
Navigation & expansion
| Name | Type | Description |
|---|---|---|
scrollToRow(target: number | RowKey): void | void | Scrolls a row into the viewport by flat index or key. |
navigateToRow(key: RowKey): void | void | Scrolls to the row and focuses it when focusedRowEnabled. |
expandRow(key) / collapseRow(key) | void | Expands/collapses a group row (group node key) or master-detail row. |
isRowExpanded(key): boolean | boolean | Expansion state of a group or master-detail row. |
expandAllGroups() / collapseAllGroups() | void | Expands/collapses every group row (all levels). |
Selection
| Name | Type | Description |
|---|---|---|
selectAll(): void | void | Selects the current filtered set; honors selectAllMode and deferred mode. |
deselectAll() / clearSelection() | void | Clears the selection (deferred mode: resets selectionFilter). |
isRowSelected(key): boolean | boolean | Whether the row is currently selected. |
getSelectedRowsData(): T[] | T[] | Data of the selected rows among the loaded rows. |
copyToClipboard(): Promise<void> | Promise<void> | Copies the selected rows (or the focused cell) as tab-separated values. |
Editing
| Name | Type | Description |
|---|---|---|
addRow(): void | void | Adds a new (unsaved) row and opens its editors; initNewRow can prefill. Requires allowAdding. |
editRow(key: RowKey): void | void | Opens the row editor (row/form/popup modes). Requires allowUpdating. |
deleteRow(key: RowKey): void | void | Deletes the row: staged in batch mode (toggle = undelete), saved immediately otherwise. Requires allowDeleting. |
saveChanges(): void | void | Commits the open editor and (batch) saves the staged change set. savingChanges can cancel. |
discardChanges(): void | void | Discards pending changes and closes any open editor; emits editCanceled. |
hasChanges(): boolean | boolean | Whether unsaved edits exist. |
Paging
| Name | Type | Description |
|---|---|---|
pageIndex(): number / setPageIndex(index) | number / void | Zero-based page getter / clamped setter. |
pageSize(): number / setPageSize(size) | number / void | Page size getter / setter; 0 turns paging off. |
pageCount(): number | Signal<number> | Number of pages; 1 when paging is off. |
Columns & summaries
| Name | Type | Description |
|---|---|---|
showColumnChooser(anchor?) / hideColumnChooser() | void | Opens the column chooser below anchor (e.g. a button in your own header bar, with columnChooser off so no toolbar row is drawn), else below its toolbar button or the grid's start edge / closes it. |
getTotalSummaryValue(field, type?) | unknown | Raw value of a totalSummary by field (and type, when a column has several); undefined when none is configured or data has not loaded. |
Loading, state & export
| Name | Type | Description |
|---|---|---|
beginCustomLoading(message?) / endCustomLoading() | void | Shows/hides the load panel with an optional message — independent of data activity. |
state(): GridStateSnapshot / applyState(snapshot) | GridStateSnapshot / void | Captures / applies the persistable UI state. applyState validates the snapshot first (sanitize*StateSnapshot): unknown keys are dropped, prototype keys rejected, wrong types skipped — invalid input is ignored, never thrown. |
clearFilters() / clearSorting() | void | Clears every filter (row, header, builder, search) / the sort order. |
getExportData(options?): Promise<OgeExportData<T>> | Promise | Rows, column metadata (width, alignment, pin side, band) and the structured lines — group rows, group footers, the total row (items) — of the current view. scope: 'all' | 'page' | 'selection' (or selectedRowsOnly), visibleColumnsOnly: false adds hidden columns, groups / summaries: false export flat. |
getCsv(options?): Promise<string> | Promise<string> | CSV of the current view. Cells a spreadsheet would evaluate as a formula (first non-whitespace character =, +, -, @ or a full-width = + - @, or a leading tab/CR) are prefixed with an apostrophe so the file cannot execute on open — CSV formula injection. Numbers are exempt, so a -5 column stays numeric. Pass formulaGuard: false when the output is machine-read rather than opened in a spreadsheet. |
exportCsv(filename = 'grid.csv', options?): Promise<void> | Promise<void> | Downloads the current view as CSV; fires the cancelable exporting event first. options are getCsv()’s (scope, customizeCell, separator…); formula-leading cells are always neutralized. |
Ranges, clipboard & undo
| Name | Type | Description |
|---|---|---|
selectRange(range, add?) | (range: OgeGridCellRange, add?: boolean) => void | Selects a rectangular cell range; add keeps the existing ones. |
clearRangeSelection() | () => void | Clears every cell range. |
getSelectedRangeData() | () => unknown[][] | The selected cells’ values as a rows × columns matrix (the lattice Ctrl+C copies). |
pasteText(text) | (text: string) => Promise<number> | Pastes a TSV block into the editable cells from the focused cell (or fills the selected range with a single value): parsed with the column data type and lookup, validated, written as one undoable batch through the regular edit events. Resolves with the cells written. |
fillDown() / fillRight() | () => Promise<number> | Ctrl+D / Ctrl+R: copies the range’s first row (column) into the rest — a single row copies the row above it. |
undo() / redo() | () => Promise<void> | Ctrl+Z / Ctrl+Y: reverts or re-applies the last committed edit, paste or fill (staged in batch mode, saved otherwise). |
canUndo() / canRedo() | () => boolean | Whether the history has a step to revert / re-apply. |
autoFitColumn(field) / autoFitColumns() | (field: string) => void | Sizes a column (or every column) to its header and rendered cells — what a double-click on the resize handle and the header menu’s “Size to fit” run. |
Events 33
Interaction
| Name | Type | Description |
|---|---|---|
rowClick / rowDblClick | OgeRowClickEvent<T> | { row, key, event }. |
cellClick / cellDblClick | OgeCellClickEvent<T> | { row, key, field, value, event }. |
rowContextMenu | OgeContextMenuEvent<T> | Row right-click — and the Menu key / Shift+F10 in a focused cell; push into items to open the built-in menu. source is 'pointer' or 'keyboard' (then clientX/Y is the cell's start/bottom corner); event is the originating event. |
headerContextMenu | OgeHeaderContextMenuEvent | Prebuilt, mutable header menu items (sort/group/pin/hide); also opened by the Menu key / Shift+F10 on a focused header. Carries source and event like rowContextMenu. |
rowReordered | OgeRowReorderedEvent<T> | A row was dropped in a new position (rowDragging). |
Selection & focus
| Name | Type | Description |
|---|---|---|
selectionChanged | OgeSelectionChangedEvent | { selectedKeys, addedKeys, removedKeys } after every selection change. |
focusedRowChanged | OgeFocusedRowChangedEvent<T> | { key, row } after the focused row changed. |
focusedCellChanged | OgeFocusedCellChangedEvent<T> | { rowIndex, columnIndex, key, row, field } after keyboard/pointer focus moved to another cell; key/row are undefined on group rows. |
sortChanged | OgeSortChangedEvent | { sort, previousSort } as soon as the sort changed (header, menu, API) — no debounce, unlike stateChange. The initial sort is not a change. |
pageChanged | OgePageChangedEvent | { pageIndex, pageSize, previousPageIndex, previousPageSize } after the page index or size changed. |
rowExpanding | OgeGridRowTogglingEvent<T> | Before a group or master-detail row expands (pointer, keyboard or expandRow()); { key, kind, row, cancel } — set cancel to veto. Not fired per row by expandAllGroups(). |
rowExpanded | OgeGridRowToggleEvent<T> | { key, kind: 'group' | 'detail', row } after the row expanded. |
rowCollapsing | OgeGridRowTogglingEvent<T> | Before a group or master-detail row collapses; cancelable. |
rowCollapsed | OgeGridRowToggleEvent<T> | After a group or master-detail row collapsed. |
selectedKeysChange / focusedRowKeyChange / filterValueChange / selectionFilterChange | model outputs | Implicit outputs of the two-way models. |
Editing lifecycle
| Name | Type | Description |
|---|---|---|
editingStart | OgeEditingStartEvent<T> | Cancelable — before a cell or row editor opens. |
initNewRow | OgeInitNewRowEvent | Write into values to prefill rows created by addRow(). |
rowInserting / rowInserted | OgeRowInserting/-edEvent | Around each DataSource insert; rowInserting cancelable. |
rowUpdating / rowUpdated | OgeRowUpdating/-edEvent | Around each DataSource update; rowUpdating cancelable (carries row + values). |
rowRemoving / rowRemoved | OgeRowRemoving/-edEvent | Around each DataSource remove; rowRemoving cancelable. |
savingChanges / savedChanges | OgeSaving/-edChangesEvent<T> | Whole batch before (cancelable) / after the save. |
editCanceled | void | An edit session ended without saving. |
Lifecycle & errors
| Name | Type | Description |
|---|---|---|
contentReady | void | A new result set finished rendering (post-render notification). |
stateChange | GridStateSnapshot | Debounced — the persistable UI state changed. |
exporting | OgeExportingEvent | Cancelable, mutable fileName — before a CSV export. |
dataErrorOccurred | OgeDataErrorEvent | { error } — a DataSource load or save failed. |
Ranges, preparation & drag
| Name | Type | Description |
|---|---|---|
rangeSelectionChanged | OgeRangeSelectionChangedEvent | The selected ranges changed: { ranges, rowCount, columnCount, cellCount }. |
rowPrepared | OgeRowPreparedEvent<T> | A data row element rendered a row for the first time (scrolled in, re-keyed) — { row, key, rowIndex, element }, the imperative escape hatch the declarative hooks cannot cover. |
cellPrepared | OgeCellPreparedEvent<T> | Every data cell of a prepared row: { row, key, field, value, rowIndex, columnIndex, element }. |
rowDragStart | OgeRowDragStartEvent<T> | Cancelable: a row drag is about to start. |
rowDragOver | OgeRowDragOverEvent | Cancelable, on the grid under the pointer: a dragged row of the group hovers it; set cancel to refuse the spot. |
rowDrop | OgeRowDropEvent | A row was dropped on this grid — its own (a reorder, which also fires rowReordered) or another component’s (sameComponent: false): { sourceComponentId, targetComponentId, sourceKey, sourceRow, targetKey, targetRow, position, toIndex }. |
rowDragEnd | OgeRowDragEndEvent<T> | The source side of a drag ended: { key, row, dropped, targetComponentId }. |
OgeColumn
oge-columnProperties 29
Companion directives
| Name | Type | Default | Description |
|---|---|---|---|
OgeColumnGroup | oge-column-group — input: caption (required) | — | Banded header: wraps sibling <oge-column> elements under one shared caption. Re-exported by @oge-ui/tree-list. |
OgeGridToolbarItem | directive — [ogeToolbar] | — | Marks projected content as a toolbar item. The toolbar appears as soon as one item exists, alongside the built-in controls. Named OgeGridToolbarItem so it cannot collide with @oge-ui/layout’s OgeToolbarItem; the selector is unchanged. |
Basics
| Name | Type | Default | Description |
|---|---|---|---|
field | string | undefined | — | Data field (dot paths supported via accessors). |
caption | string | undefined | — | Header text; humanized from field when omitted. |
dataType | OgeDataType | 'string' | 'string' | 'number' | 'date' | 'datetime' | 'boolean' — drives editors, filters and the default alignment. 'datetime' keeps the time of day (date + time cells and editor; filters by calendar day). |
alignment | OgeColumnAlignment | undefined | — | 'start' | 'center' | 'end' for cells, header and summaries (logical — 'end' is the right edge in LTR). Unset, numbers align to the end and everything else to the start. |
width / minWidth | number | string / number | — | Track size; minWidth guards resizing. |
maxWidth | number | undefined | undefined | Upper bound in px for user resizing — pointer drag and the Alt+←/→ / separator keys; also the separator’s aria-valuemax. |
visible | model<boolean> | true | Two-way visibility (column chooser writes it). |
format | (value: unknown) => string | undefined | — | Display formatter for cells, group rows, export. |
pinned | false | 'left' | 'right' | false | Pins the column to an edge. |
hidingPriority | number | undefined | — | Adaptive hiding order when width runs out (higher survives longer); the hidden values stay reachable through the row toggle unless columnHidingMode is 'hide'. |
lookup | OgeColumnLookup | undefined | — | Display + dropdown editor from a value list; cascading via function dataSource. |
Sort, filter & group
| Name | Type | Default | Description |
|---|---|---|---|
sortable / filterable | boolean | true | Per-column opt-outs. |
sortOrder / sortIndex | 'asc' | 'desc' / number | — | Initial sort (stateKey/user wins). |
groupIndex | number | undefined | — | Initial grouping position. |
groupInterval | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year' | number | undefined | — | Bucket when grouping by this column — calendar units for dates ('day' by default for date / datetime; 'week' starts on the locale’s first day of week) or a positive width for numbers (100 → 0–99, 100–199…). Captions read Week of …, Q2 2026, 100 – 200. Sent as LoadOptions.group[].interval. |
filterOperator | FilterOperator | undefined | — | Initial operator of the filter-row cell. |
calculateCellValue | (row: T) => unknown | — | Calculated column value. |
calculateSortValue | (row: T) => unknown | — | Custom sort key. |
calculateFilterExpression | (value, operator) => FilterExpr | null | — | Custom filter expression builder. |
Summaries & editing
| Name | Type | Default | Description |
|---|---|---|---|
groupSummary / totalSummary | SummaryType | readonly SummaryType[] | — | sum/avg/min/max/count/custom aggregates per column. |
groupSummaryPosition | 'row' | 'footer' | 'row' | Group aggregates inline or in a footer row. |
calculateCustomSummary | (rows: readonly T[]) => unknown | — | Reducer for type: 'custom'. |
editable | boolean | true | Per-column editing opt-out. |
required / validators | boolean / readonly ValidatorFn[] | — | Editor validation. |
Formatting, merging & async validation
| Name | Type | Default | Description |
|---|---|---|---|
conditionalFormats | readonly OgeConditionalFormat<T>[] | undefined | — | Declarative formats: rules { when: (value, row) => boolean | { operator, value }, class?, style?: { tone, background, bold } }, { type: 'dataBar' }, { type: 'colorScale', tones? } and { type: 'iconSet', icons?, thresholds? }. Token classes and CSS custom properties only — themes and forced colours keep working. |
mergeCells | boolean | false | Merges vertically adjacent equal values into one cell (aria-rowspan); not applied while virtualized. |
asyncValidators | readonly AsyncValidatorFn[] | undefined | — | Async Angular validators (a server uniqueness check): the editor is aria-busy while one runs, a commit waits for it, failures use the usual error wiring; pastes and fills run them too. |
Types 8
| Name | Type | Description |
|---|---|---|
<oge-column-group caption="…"> | component | Banded (multi-row) headers — wraps child <oge-column>s. |
*ogeCellTemplate | OgeCellTemplateContext<T> | { $implicit: value, row, rowIndex, column }. |
*ogeHeaderTemplate | OgeHeaderTemplateContext<T> | { $implicit: column }. |
*ogeEditTemplate | OgeEditTemplateContext<T> | { $implicit: FormControl, row, column }. |
*ogeDetailTemplate | OgeDetailTemplateContext<T> | Master-detail content; { $implicit: row }. |
*ogeRowTemplate | OgeRowTemplateContext<T> | Full-row replacement; { $implicit: row, index, key }. |
*ogeNoDataTemplate | TemplateRef | Custom empty state. |
[ogeToolbar] | marker directive — 'before' | 'center' | 'after' | Projects custom controls into the grid toolbar. The static value picks the group: ogeToolbar="before" (start edge — filters, primary actions), "center", or bare / "after" (next to the built-in tools). |
Grid types & configuration
Types 49
Standalone building blocks
| Name | Type | Description |
|---|---|---|
OgeCellEditor | oge-cell-editor — inputs: control (required), dataType, lookupItems, label, surface, invalid, errorTitle; outputs: enterKey, escapeKey, tabKey | The editor the grid renders in a cell: picks the dataType-matched oge-*-box from @oge-ui/inputs and binds it to a reactive FormControl. Usable on its own to get grid-identical editing in a form. |
OgePager | oge-pager — inputs: pageIndex, pageCount, totalCount (required), pageSize, pageSizes, showInfo, displayMode, messages; outputs: pageChange, pageSizeChange | The grid's pager as a standalone component — reuse it under a list or a card grid so paging looks identical everywhere. |
ogeColumnFromDef(def) | (def: OgeColumnDef<T>) => OgeColumn<T> | What [columns] runs on: turns a column definition into the signal surface of an <oge-column>. For a custom grid-like component that accepts the same OgeColumnDefs. |
OgeColumnDefCache | class { resolve(defs): OgeColumn<T>[] } | Keeps one column — and its visibility — per definition object across change detection; field-name strings are cached by name. |
OgeFilterBuilderGroup | oge-filter-builder-group | Recursive node of the filter builder (a group of conditions plus nested groups). Exported so a custom filter UI can reuse the same tree editor. |
formatCellValue(value, dataType, format?) | (value: unknown, dataType: OgeDataType, format?: (value: unknown) => string) => string | The exact formatting the grid applies to a cell. Use it to keep exports, tooltips or custom templates byte-identical with the rendered grid. |
Internals — not a supported API
| Name | Type | Description |
|---|---|---|
GridStateStore | component-scoped service | Composes the state slices; loadOptions is the single choke point through which every data-affecting change triggers exactly one load. Injected by the grid, not by applications — use state() / applyState() instead. |
GridDataAdapter | component-scoped service | Bridges the reactive state to the pull-based DataSource contract with switchMap semantics, so a stale response can never win over a newer one. |
SortSlice / FilterSlice / GroupingSlice / PagingSlice / ColumnsSlice / SelectionSlice / ExpansionSlice / OgeEditingSlice | state slices | Read-only signals plus intent methods behind GridStateStore. Exported for the suite's own packages (tree-list, pivot) — treat them as internal: they may change in any release. |
Option objects (boolean shorthands stay valid)
| Name | Type | Description |
|---|---|---|
OgePagingOptions | { pageSize: number; pageSizes?: readonly (number | 'all')[]; showInfo?; displayMode?: 'full' | 'compact' | 'adaptive' } | Pager configuration. |
OgeSortingOptions | { mode?: 'none' | 'single' | 'multi'; allowUnsorting?: boolean } | Sorting behavior. |
OgeFilterRowOptions | { visible?: boolean; debounce?: number } | Filter row. |
OgeHeaderFilterOptions | { visible?: boolean; valueLimit?: number } | Header filter. |
OgeSearchPanelOptions | { visible?: boolean; placeholder?: string; width?: number } | Search panel. |
OgeScrollingOptions | { mode?: 'standard' | 'virtual' | 'infinite'; remote?: boolean; columnRenderingMode?: 'standard' | 'virtual' } | Scrolling engine. |
OgeGroupingOptions | { autoExpandAll?: boolean; contextMenuEnabled?: boolean } | autoExpandAll: false starts collapsed and defers child loading; contextMenuEnabled puts group/ungroup in the header menu without the group panel. |
OgeEditingOptions | { mode: OgeEditMode; allowUpdating?; allowAdding?; allowDeleting?; confirmDelete?; formItems?; formColCount? } | Editing configuration; OgeEditMode = cell | row | batch | popup | form. |
OgeCommandButton<T> | { name?: 'edit' | 'delete'; text?; onClick?(row, key); visible?(row) } | Command column entries. |
OgeColumnLookup | { dataSource: readonly unknown[] | ((row) => readonly unknown[]); valueExpr?; displayExpr? } | Lookup source. |
Export
| Name | Type | Description |
|---|---|---|
OgeExportOptions<T> | { scope?; selectedRowsOnly?; visibleColumnsOnly?; groups?; summaries?; customizeCell?(args); cellStyle?(args) } | Shared by CSV/Excel/PDF. customizeCell rewrites a data cell (return a value) and restyles it (mutate style); cellStyle is the value-level styling seam for every cell — header, group and summary lines included — so conditional formatting exports the same way it renders. |
OgeExportData<T> / OgeExportColumn<T> / OgeExportCellArgs<T> | interfaces | Rows + resolved column metadata handed to exporters; items carries the group / footer / total lines when the view is grouped or summarized. |
OgeExportItem<T> / OgeExportSummaryCell / OgeExportRowKind | { kind: 'data' | 'group' | 'groupFooter' | 'total'; … } | One exported line: a data row at its group depth, a group header (text, value, count, header summaries), a group footer or the total row with typed summary values. |
OgeExportCellStyle / OgeExportCellStyleArgs<T> | { bold?, italic?, underline?, color?, background?, fontSize?, alignment?, verticalAlignment?, wrap?, border?, numFmt? } | Cell style both file builders apply (colours as #rrggbb; numFmt is Excel-only). |
exportGridToExcel(grid, options?) | @oge-ui/grid/export-excel | Lazy Excel export (exceljs peer): merged band headers, frozen header rows + left-pinned columns (freezeHeader, freezeColumns), grid or auto column widths (columnWidths), number/date formats (numberFormat, dateFormat, dateTimeFormat, columnFormats), group rows with collapsible outline levels (outline), group-footer and total rows as values or SUBTOTAL formulas (summaryFormulas), headerStyle / groupStyle / summaryStyle, auto-filter. buildExcelWorkbook(data, options) for custom pipelines. |
exportGridToPdf(grid, options?) | @oge-ui/grid/export-pdf | Lazy PDF export (jspdf peer): the header block repeated on every page (repeatHeader), group and summary rows, grid widths fitted to the page (fitToWidth), orientation, pageFormat, title, pageHeader / pageFooter callbacks and pageNumbers. buildPdfDocument(data, options) for custom pipelines. Text outside WinAnsi (Turkish ğ ş ı İ, Central European, Greek, Cyrillic) needs a Unicode TrueType font — per export, or once for every PDF via setOgePdfDefaultFont({ family, normal, bold }) from @oge-ui/behavior; without one the built-in Helvetica cannot draw it (a dev-mode warning says so). |
OgeExcelExportOptions<T> / OgePdfExportOptions<T> / OgePdfPageInfo | interfaces | The two download helpers’ options (each extends OgeExportOptions) and what a PDF page callback is told (pageNumber, pageCount). |
Configuration
| Name | Type | Description |
|---|---|---|
provideOgeGridConfig(config) | Provider | App/component-scoped defaults; deep-merges messages. |
OgeGridConfig | { rowHeight: 36; detailRowHeight: 200; filterDebounce: 300; overscan: 6; columnMinWidth: 120; pinnedDefaultWidth: 150; headerFilterValueLimit: 200; allowUnsorting: true; columnHidingMode: 'detail'; announcements: true; messages } | Defaults shown inline. |
OgeGridMessages | 60+ string keys | Every user-facing string, incl. aria labels, filter operators, summary patterns — see OGE_DEFAULT_MESSAGES in the source. |
messages.reorderColumnHeader / messages.detailColumnHeader / messages.selectAllColumnHeader / messages.reorderRow | string | Accessible names of the row-drag, master-detail and selection header cells and of a row’s drag handle. Defaults: Reorder, Detail, Select all, Reorder row. The tree list reads reparentColumnHeader / reparentRow (Reparent, Reparent row) for its reparenting handle. |
messages.resizeColumn / messages.columnResized / messages.columnMoved / messages.rowMoved / messages.treeRowMoved / messages.groupMoved / messages.groupRemoved | string | The keyboard alternatives to dragging (WCAG 2.1.1 / 2.5.7): the resize separator’s name (Resize {column}) and the polite live-region announcements after a keyboard resize ({column} width {width} pixels), column move ({column} moved to position {position} of {total}), row move (Row moved to position {position} of {total}), tree-row move (Row moved to level {level}, position {position} of {total}) and group-chip reorder / removal (Grouping by {column} moved to position {position} of {total}, Grouping by {column} removed). |
messages.booleanTrueLabel / messages.booleanFalseLabel | string | Screen-reader text of a default-rendered boolean cell (Yes / No). The visible booleanTrue / booleanFalse glyph (✓ / ✗, also the CSV text) is rendered aria-hidden; the label is rendered visually hidden beside it. Columns with a custom format, a lookup or a cell template render their own text. Localizing booleanTrue / booleanFalse to words? Set the labels too — they are announced, the glyph text is not. |
messages.sortAscendingAnnouncement / messages.sortDescendingAnnouncement / messages.sortClearedAnnouncement / messages.rowCountAnnouncement / messages.rowCountOneAnnouncement / messages.pageAnnouncement / messages.groupExpandedAnnouncement / messages.groupCollapsedAnnouncement / messages.rowExpandedAnnouncement / messages.rowCollapsedAnnouncement / messages.selectionCountAnnouncement / messages.validationErrorAnnouncement | string | Live-announcement patterns, {placeholder}-interpolated. Defaults: Sorted by {column}, ascending / descending, Sort cleared, {count} rows / {count} row, Page {n} of {total}, Group {value} expanded / collapsed, {value} expanded / collapsed (tree list), {count} rows selected and {column}: {error} (spoken assertively when a save is blocked by an invalid editor). |
OGE_STATE_STORAGE / OgeStateStorage | InjectionToken | Pluggable sync/async persistence backend for stateKey. |
Filter builder
| Name | Type | Description |
|---|---|---|
builderToExpr / exprToBuilder / describeExpr / operatorsFor | functions | Convert between builder trees and FilterExpr; humanize expressions. |
OgeBuilderGroup / OgeBuilderCondition / OgeFilterBuilderField | interfaces | Filter-builder data model. |
Ranges, formats, spans & drag
| Name | Type | Description |
|---|---|---|
OgeGridCellRange / OgeGridCellCoord | interfaces | { anchor, focus } of { row, col } — flat row index and visible column index, the keyboard machine’s coordinates. |
OgeRangeSelectionOptions | interface | { copyHeaders?, fillHandle?, pasteAddsRows?, multipleRanges? }. |
OgeRangeSelectionChangedEvent | interface | { ranges, rowCount, columnCount, cellCount }. |
OgeClassValue | type | What class hooks return: string | string[] | Record<string, boolean> | null. |
OgeGridColumnInfo | interface | { field, caption, dataType, index } — what cellClass / cellSpan learn about a column. |
OgeConditionalFormat | type | A rule or a data bar / colour scale / icon set (see conditionalFormats). |
OgeGridCellSpan | interface | { rowSpan?, colSpan? }. |
OgeRowPreparedEvent / OgeCellPreparedEvent | interfaces | Payloads of rowPrepared / cellPrepared. |
OgeRowDragStartEvent / OgeRowDragOverEvent / OgeRowDropEvent / OgeRowDragEndEvent / OgeRowDropPosition | interfaces | Cross-component row drag payloads; position is 'before' | 'after' | 'inside'. |
OgeHeaderFilterMode | type | headerFilter.mode: 'list' (default) the value checklist, 'conditions' two operator + value conditions joined by And / Or, 'both' the Excel-style menu (conditions above the list). Date columns list their values as a year → month → day tree. |
OgePagerInfoTemplate | directive | *ogePagerInfoTemplate="let info" replaces the pager’s info text; info is { pageIndex, pageCount, totalCount, pageSize, firstRow, lastRow, text }. paging.showFirstLastButtons / paging.showPageInput add first/last buttons and a go-to-page input. |
messages.rangeSelectedAnnouncement / messages.cellsPastedAnnouncement / messages.cellsFilledAnnouncement / messages.undoAnnouncement / messages.redoAnnouncement / messages.fillHandle / messages.validationPending / messages.autoFitColumn | string | Range, paste, fill and undo announcements ({rows} by {columns} cells selected, {count} cells pasted…), the fill handle’s tooltip, the busy editor’s status text and the “Size to fit” header-menu item. |
messages.filterByCondition / messages.filterByValues / messages.firstCondition / messages.secondCondition / messages.firstPage / messages.lastPage / messages.goToPage / messages.pageOfCount / messages.groupWeekPattern / messages.groupQuarterPattern / messages.groupRangePattern | string | Header filter menu sections and condition names, pager first/last/go-to-page labels (of {count}) and the interval group captions (Week of {date}, Q{quarter} {year}, {from} – {to}). |
Notes
- Methods are reached through a template reference (
viewChild(OgeGrid)) — there is noinstance()/option()machinery; state flows through signal inputs and two-way models. - jQuery-era members (
repaint(),beginUpdate(),onOptionChanged…) are intentionally absent; the ROADMAP's "API parity" section documents every mapping decision.