Whether the grid will try to "resolve" its column configuration based on the passed data source.
This is usually executed on initial rendering in the DOM. It depends on having an existing data source to infer the column configuration for the grid. Passing an empty data source or having a late bound data source (such as a HTTP request) will usually result in empty column configuration for the grid.
This property is ignored if any existing column configuration already exists in the grid.
In a scenario where you want to bind a new data source and still keep the auto-generation behavior, make sure to reset the column collection of the grid before passing in the new data source.
Enables drag-and-drop column reordering on the column headers.
Per-column opt-out is available through BaseColumnConfiguration.reorderable. Reordering is constrained to a column's own pinning group — start-pinned columns can only swap with start-pinned, unpinned with unpinned, and end-pinned with end-pinned.
Column configuration for the grid.
The data source for the grid.
Configuration object which controls remote data operations for the grid.
OptionaleditingInline editing configuration for the grid.
Editing is disabled by default. Set enabled: true and (optionally) mode
('cell' | 'row') and trigger ('click' | 'doubleClick') to opt in.
Per-column opt-in is required via BaseColumnConfiguration.editable.
OptionalexpansionRow-expansion (master-detail) configuration for the grid.
OptionalpaginationPagination configuration for the grid.
Pagination is disabled by default. Set enabled: true and (optionally) pageSize
to render the built-in <apex-grid-paginator> and slice the dataView. For
server-side pagination set mode: 'remote' and supply totalItems. The grid
emits the cancellable pageChanging event before applying a change and the
pageChanged event after the pipeline has run.
The quick-filter (global search) value applied to the dataView.
When non-empty, the grid filters records whose visible-column values contain the term (case-insensitive substring match). Customise by providing DataPipelineConfiguration.quickFilter.
OptionalselectionRow selection configuration for the grid.
Whether the built-in export menu is rendered in the toolbar.
When true, the toolbar shows a download button on the trailing side;
clicking it opens a menu with one entry per ApexGrid.exportFormats
(CSV in the community grid) that calls ApexGrid.exportAs.
ApexGrid.exportToCSV remains callable programmatically regardless
of this flag.
Whether the built-in quick-filter input is rendered in the toolbar.
The ApexGrid.quickFilter value can be controlled programmatically regardless of this flag; this only controls the toolbar input UI.
Sort configuration property for the grid.
OptionaltreeTree-data (nested rows) configuration for the grid.
Tree mode keeps ApexGrid.data flat; the grid derives the
hierarchy from a user-supplied getDataPath(row) callback (AG Grid's
"tree data" pattern). When enabled, the first visible data column (or
the column referenced by groupColumnKey) renders a chevron toggle
and depth-based indentation.
Returns the state of the data source after sort/filter operations have been applied.
The columns in visual render order: 'start'-pinned columns first, then
unpinned columns, then 'end'-pinned columns.
Use this when you need to iterate the columns in the same order the grid actually displays them (for example to build a column chooser). Public APIs like ApexGrid.getColumn continue to operate on the user-supplied ApexGrid.columns array.
The cell currently in edit mode, or null.
The view-relative index of the row currently in edit mode (row edit mode
only), or null.
The currently expanded rows, in insertion order.
The export formats offered in the toolbar's export menu, in order.
The community grid offers CSV only. This is the seam derived grids use to
contribute more formats: @apexcharts/grid-enterprise overrides it to add
'xlsx'. The toolbar renders one menu item per entry and dispatches the
chosen id to ApexGrid.exportAs.
Get the filter state for the grid.
The current zero-based page index.
The total number of pages computed from ApexGrid.totalItems and ApexGrid.pageSize.
The records currently rendered into the virtualized body.
Equal to ApexGrid.dataView when pagination is disabled. With pagination
enabled ('local' mode) this is the active page slice.
The current page size.
Returns the collection of rendered row elements in the grid.
The currently selected rows, in insertion order.
Get the sort state for the grid.
The total number of items in the ApexGrid.dataView collection.
This is always the post-filter, post-sort row count — pagination does not change it. Use ApexGrid.pageItems to read the rows currently rendered into the body.
Sets the live region's announcement text. Screen readers configured to read polite live updates will read the new value aloud.
Discards the current edit without writing back to ApexGrid.data.
Clears the row selection.
Collapses every currently expanded row.
Collapses every currently-expanded tree row.
Collapses row. No-op when the row is not currently expanded.
Collapses a tree row. No-op when the row is not currently expanded.
Begins editing the cell at (rowIndex, columnKey).
rowIndex is the view-relative index (matches ApexGrid.pageItems).
Returns false when the column isn't editable, the row index is out of
range, or the request was rejected (for example in row mode with pending
changes that couldn't be committed).
Begins editing the entire row at rowIndex (row edit mode only).
false when editing is disabled, the grid is in cell mode, or
the row index is out of range.
Expands every row in ApexGrid.dataView that passes the optional
isExpandable predicate.
Expands every parent row in the current tree.
Expands row. No-op when the row is already expanded, expansion is
disabled, or the optional isExpandable predicate rejects it.
Expands a tree row. No-op when the row is already expanded, has no children, or tree mode is disabled.
Exports the grid in the given format (one of ApexGrid.exportFormats).
Called by the toolbar's export menu. The community grid handles 'csv';
derived grids override to handle additional formats, delegating to super
for the ones they don't add.
Exports the current grid contents as a CSV string and (in a browser context) triggers a download.
By default the export uses the post-filter/post-sort dataView, includes
every visible column with exportable !== false, and prepends a UTF-8 BOM
so Excel opens the file with the right encoding. Pass source: 'page' to
export only the current page, source: 'selected' to export the current
row selection, or source: 'all' to export the raw data array. The
returned string is the same content written to the file — useful for
tests or routing the bytes elsewhere.
Performs a filter operation in the grid based on the passed expression(s).
Navigates to the first page.
Returns a ColumnConfiguration for a given column.
Navigates the grid to the given zero-based page index.
The target zero-based page index.
true if the change was applied, false if cancelled or a no-op.
Navigates to the last page.
Moves a column relative to another column.
The column to move.
The reference column.
Whether to place fromKey before or after toKey. Defaults to 'before'.
true if the move was applied, false if cancelled or a no-op.
Emits the cancellable columnMoving event first and columnMoved after.
Reordering only succeeds when the source and target columns share the same
pinning group (start / unpinned / end) — cross-group moves return false.
Use ApexGrid.pinColumn to change a column's pinning group first.
Navigates to the next page. No-op if already on the last page.
Pins a column to one of the grid's edges, or unpins it when position is null.
The target column key.
'start', 'end', or null to unpin.
true if the change was applied, false if cancelled or a no-op.
Emits the cancellable columnPinning event first and the columnPinned
event after the update is applied. The user-supplied ApexGrid.columns
array is not reordered — only the visual render order changes.
Navigates to the previous page. No-op if already on the first page.
Selects every row in the current view (dataView). No-op in
'single' selection mode.
Selects row, replacing the existing selection in 'single' mode or
adding to it in 'multiple' mode.
true if the selection changed, false if the change was
rejected by a rowSelecting listener or selection is disabled.
Updates the grid's page size and returns to the first page.
The new page size (must be a positive integer).
true if the change was applied, false if cancelled or a no-op.
Applies a new quick-filter (global search) value, emitting the cancellable
quickFilterChanging event first and the quickFilterChanged event after the
pipeline has run.
The new quick-filter value. Pass '' to clear.
true if the change was applied, false if cancelled or a no-op.
Performs a sort operation in the grid based on the passed expression(s).
Toggles tree-expansion of row. No-op when tree mode is disabled or
the row has no children.
Unpins a column. Equivalent to ApexGrid.pinColumn(key, null).
The target column key.
true if the change was applied, false if the column was already
unpinned or the operation was cancelled.
Updates the column configuration of the grid.
StaticregisterRegisters <apex-grid> and its internal dependencies with the custom-element
registry. Idempotent — safe to call more than once.
StaticstylesArray of styles to apply to the element. The styles should be defined using the css tag function, via constructible stylesheets, or imported from native CSS module scripts.
Note on Content Security Policy:
Element styles are implemented with <style> tags when the browser doesn't
support adopted StyleSheets. To use such <style> tags with the style-src
CSP directive, the style-src value must either include 'unsafe-inline' or
nonce-<base64-value> with <base64-value> replaced be a server-generated
nonce.
To provide a nonce to use on generated <style> elements, set
window.litNonce to a server-generated nonce in your page's HTML, before
loading application code:
<script>
// Generated and unique per request:
window.litNonce = 'a1b2c3d4';
</script>
Apex grid is a web component for displaying data in a tabular format quick and easy.
Out of the box it provides row virtualization, sort and filter operations (client and server side), the ability to template cells and headers and column hiding.
Remarks
A working, styled grid requires three things:
import 'apex-grid/define'(orApexGrid.register()).apex-grid { height: 480px }— the virtualizer collapses without one.displayon the host — the component declares:host { display: grid }internally and any override breaks the track layout.The grid is styled out of the box through
--ag-*CSS custom properties — there is no theme to import and noconfigureTheme()call. Override--ag-*tokens on the host (or any ancestor) to rebrand; whenigniteui-webcomponentsis present, the brand tokens auto-tint from its palette. For dark mode, set thetheme="dark"attribute on the host for the built-in slate dark palette (further--ag-*overrides still compose on top). Addtinted(e.g.theme="tinted"ortheme="dark tinted") to mix the brand into the chrome so the grid wears its brand even at rest. See the README "Getting Started" and "Theming" sections for the full example and token list.Element
apex-grid
Attr
theme - Space-separated theme flags.
darkopts into the built-in dark palette;tintedmixes--ag-brandinto the chrome surfaces. Combine astheme="dark tinted".Fires
sorting - Emitted when sorting is initiated through the UI.
Fires
sorted - Emitted when a sort operation initiated through the UI has completed.
Fires
filtering - Emitted when filtering is initiated through the UI.
Fires
filtered - Emitted when a filter operation initiated through the UI has completed.
Fires
pageChanging - Cancellable. Emitted before page/page-size changes are applied.
Fires
pageChanged - Emitted after a page/page-size change has been applied.
Fires
quickFilterChanging - Cancellable. Emitted before a quick-filter value is applied.
Fires
quickFilterChanged - Emitted after a quick-filter change has been applied.
Fires
columnPinning - Cancellable. Emitted before a column's pin position changes.
Fires
columnPinned - Emitted after a column's pin position has changed.
Fires
columnMoving - Cancellable. Emitted before a column is moved.
Fires
columnMoved - Emitted after a column has been moved.
Fires
cellValueChanging - Cancellable. Emitted before a cell value is committed.
Fires
cellValueChanged - Emitted after a cell value has been committed.
Fires
rowEditStarted - Emitted when a row enters edit mode (row mode only).
Fires
rowEditEnded - Emitted when a row leaves edit mode (row mode only).
Fires
rowSelecting - Cancellable. Emitted before a selection-set change is applied.
Fires
rowSelected - Emitted after a selection-set change has been applied.
Fires
rowExpanding - Cancellable. Emitted before the row-expansion set changes (master-detail).
Fires
rowExpanded - Emitted after a row-expansion change has been applied.
Fires
treeRowExpanding - Cancellable. Emitted before a tree-row expansion change (tree mode).
Fires
treeRowExpanded - Emitted after a tree-row expansion change has been applied.
Csspart
live-region - Visually-hidden ARIA live region used for screen-reader announcements.
Cssprop
[--ag-brand] - Brand color for selection, focus rings, and accents. Auto-tints from
--ig-primary-500when igniteui is present.Cssprop
[--ag-brand-strong] - Brand color for hover / pressed states.
Cssprop
[--ag-grid-shadow] - Grid edge/shadow override. Default is a flat 1px hairline edge; set to
var(--ag-shadow-card)for the elevated card look, ornoneto remove it.Cssprop
[--ag-grid-bg] - Host card background. Defaults to a subtle light gradient; override with a flat color (or use
theme="dark") for dark themes.Cssprop
[--ag-surface] - Grid card background (must be opaque).
Cssprop
[--ag-surface-alt] - Alternating row tint.
Cssprop
[--ag-surface-elevated] - Header background.
Cssprop
[--ag-hairline] - Header / structural gridline color.
Cssprop
[--ag-border] - Row separator color.
Cssprop
[--ag-text] - Primary text color.
Cssprop
[--ag-text-body] - Row text color.
Cssprop
[--ag-text-muted] - Muted text (roles, labels).
Cssprop
[--ag-row-hover] - Row hover wash.
Cssprop
[--ag-row-h] - Row height.
Cssprop
[--ag-header-h] - Header height.
Cssprop
[--ag-radius] - Outer card corner radius.
Cssprop
[--ag-font] - Grid font family.
Cssprop
[--ag-fs-cell] - Cell font size.
See
_tokens.scss for the complete
--ag-*token list.