gridcn2.0.0
Cheatsheets and messages

Actions A to Z

Find a store action by name, read what it does, and open the page that explains its feature.

Each row is a method of DataGridActions. useDataGridActions() and api.actions return the same object. An action with a CellRef takes a row id and a column id. A cell action that ends in At takes a ViewCoord, a position in view indexes. A row action that ends in At (setRowCheckedAt, deleteRowsAt, duplicateRowsAt) takes view row numbers: one number, or a number[].

ActionPurposePage
applyCellUpdatesWrites values at view coordinates as one change with the given source, and selects the touched cells.Store hooks
autosizeColumnsSizes columns to their content over the view and returns the measured widths. On a paged grid, it measures the shown page.Column sizing
cancelColumnResizeEnds a resize drag without a commit and restores the width the drag started from. Fires onColumnResizing.Store hooks
cancelEditingDiscards the open edit. It writes nothing.Edit and validation events
canSetColumnOrderReturns the result that setColumnOrder returns for the same arguments, without the move.Exported types
checkRowRangeChecks or unchecks the rows from the anchor row to a target view index.Store hooks
clearCellErrorsClears the cell errors of targets. Without targets, it clears every cell error.Show errors on cells
clearCellSelectionClears the cell ranges and the column selection, and keeps the checked rows.Store hooks
clearSaveStatusDrops the "failed" mark of each row whose save the server refused. A row that is still "saving" keeps its mark.Save edits
clearSelectionClears the cell ranges, the column selection, and the checked rows.Checked rows
collapseAllCloses every group.Row grouping
commitCellEditValidates and commits the open edit. A refused value keeps the editor open. A commit moves the active cell by movement.Store hooks
commitCellValueValidates and writes a value at a CellRef without an edit session, as a checkbox does.Store hooks
commitCellValueAtTakes a ViewCoord in place of the CellRef of commitCellValue.Store hooks
commitChangeApplies a whole DataChange in one write and fires onDataChange once.Data change events
deleteRowsDeletes the rows with the given ids, as one change. The grid skips an id that matches no row. Returns a RowActionResult.Row operations
deleteRowsAtDeletes the rows at the given view indexes, as one change. Returns a RowActionResult.Row operations
deleteSelectionClears every editable cell of the selection to its empty value, as one change.Store hooks
duplicateRowsDuplicates the rows with the given ids through duplicateRow, as one change. Returns a RowActionResult.Row operations
duplicateRowsAtDuplicates the rows at the given view indexes through duplicateRow, as one change. Returns a RowActionResult.Row operations
editRowsWrites whole-row patches as a user edit: source: "edit", one undo entry, and one onSave. The readOnly, read-only column, and validate checks apply.Edit rows in forms
expandAllOpens every group.Row grouping
extendSelectionGrows or shrinks the main range by one cell in a direction, or moves its edge to the edge of the view with toEdge.Store hooks
extendToExtends the selection to the cell named by the stable CellRef.Store hooks
extendToAtTakes a ViewCoord in place of the CellRef of extendTo.Store hooks
flashCellsPlays the fade pulse on the given cells. It is not a data change.Push live values
insertRowInserts one row from createRow above or below a view index. Returns a RowActionResult.Row operations
insertRowsInserts count rows from createRow above or below a view index, as one change. Returns a RowActionResult.Row operations
moveRowsByShifts rows by delta and keeps the gaps between them. Returns whether rows moved.Row order
previewColumnWidthWrites a column width while a resize drag moves. Fires onColumnResizing.Column sizing
pushRangeAdds a new range at a CellRef, as a Ctrl or Cmd click does.Store hooks
pushRangeAtTakes a ViewCoord in place of the CellRef of pushRange.Store hooks
reconcileViewRebuilds the view index that a deferred updateCells postponed, and clears viewStale.Push live values
reorderRowsMoves rows as one block to a view index. Returns whether rows moved.Row order
replaceRowIdSwaps the id of a row for the id that the server assigned, in one write.Save edits
replaceRowIdsSwaps the ids of many rows in one write, with one onDataChange.Save edits
resetColumnLayoutRestores the widths, order, pins, and hidden columns of the column definitions in one change.Save a column layout
resetColumnWidthDrops the width override of a column, so the column gets its width from the definition again.Column sizing
selectAllRuns one step of the select-all shortcut. The first call selects the filled block around the active cell, and a repeat selects every cell.Global shortcuts
selectAllMatchingChecks every row of the result: every page of a client-paged grid, or every row of a server result, loaded or not. It returns { ok: true }, or { ok: false, reason } and changes nothing.Select server rows
selectCellSelects the cell named by the stable CellRef as a single-cell selection.Exported types
selectCellAtTakes a ViewCoord in place of the CellRef of selectCell.State and view index
selectColumnSelects the column at a view column index, as a click on its header does.Shortcut remapping
selectRowSelects the row at a view index, as a click on its row marker does.Row markers
setActiveCellMoves only the active cell to a CellRef and keeps the selection. null clears it. Fires no onSelectionChange.Store hooks
setActiveCellAtTakes a ViewCoord in place of the CellRef of setActiveCell.Store hooks
setAllRowsCheckedChecks or unchecks every row of the view, as the header checkbox does. On a paged grid, the view is the shown page. With totalRowCount, checkedRowsLifetime='across-filters', and unloaded rows in the view, checking selects all matching.Client pagination
setCellErrorsMerges server errors into the cell errors. It is not a data change.Show errors on cells
setColumnHiddenShows or hides a column.Column visibility
setColumnLayoutApplies a partial ColumnLayout as one commit. Omitted parts keep their value.Column order and pinning
setColumnOrderMoves a column, or a column group, before or after another column. Returns { ok: true }, or { ok: false, reason } when the order stays.Column order and pinning
setColumnPinPins a column to "start" or "end", or unpins it with null.Column order and pinning
setColumnWidthSets a column width and fires onColumnLayoutChange once, as a resize release does.Column sizing
setExpandedSets the open groups.Row grouping
setFilterJoinSets how the top-level filters combine and emits onFilterJoinChange. A controlled grid only emits.Filtering
setFiltersReplaces the filter tree.Filtering
setGroupBySets the group columns. Unknown, groupable: false, and repeated ids drop.Row grouping
setPageShows a page of the view. Pages start at 1. Calls onPageChange.Client pagination
setPageSizeShows pageSize rows per page and keeps the first row of the page on screen. null shows every row for an uncontrolled page size.Client pagination
setRowCheckedChecks or unchecks one row by id. It sets the state and never toggles.State and view index
setRowCheckedAtChecks or unchecks one row by view index. It sets the state and never toggles.State and view index
setSearchSets the quick-search text. With options, it also sets the search options.Quick search
setSelectionApplies a whole SelectionState in CellRef terms. null clears the selection.Selection and cell events
setSortsReplaces the active sorts.Sorting
startEditingOpens an editor at a CellRef, with optional first text.Edit and validation events
startEditingAtTakes a ViewCoord in place of the CellRef of startEditing.Store hooks
toggleGroupOpens a closed group and closes an open one.Row grouping
toggleGroupByAdds the column as the innermost group level, or removes it.Row grouping
toggleSortSteps the sort of a column to the next direction or to no sort, as a header click does. { additive: true } keeps the other sorts.Sort and filter events
updateCellsWrites cell patches by row id in one write, without a view rebuild. Default source is "stream".Push live values
updateRowsWrites whole-row patches by row id. Each RowPatch expands to one cell patch per column, as in updateCells.Push live values

On this page