gridcn2.0.0
Support and upgrades

2.0 breaking changes

Each breaking change from 1.3 to 2.0 with the 1.3 form, the 2.0 form, and the change to make in your code.

Each row is one Breaking: entry of the changelog. Add-on breaking changes lists the import, export, find and replace, and presence rows. Migrate to 2.0 gives the order of the steps.

AreaRows
Sorting and filteringSorts, filters
Selection and row actionsChecked rows
Editing and validationGates, validation
Columns and stylingPins, widths, locale
KeyboardKeys, shortcuts
Server data and paginationScroll rows, pagers
Exports and labelsBarrels, labels

Sorting and filtering

Change1.32.0What to change
Text sort languageThe runtime languagelocale, then "en-US". sortLocale overrides it.Pass locale or sortLocale. A custom text compare calls sortCollator().compare.
text, longText, and url orderlocaleCompare: item10 before item2Numeric and case-insensitive: item2 before item10Set sortCompare to localeCompare.
Sort, filter, and search callbacksFire before the write. A throw stops the write.Fire after the write. A throw keeps the write.Keep your own copy of the old value.
FilterOperatorA closed unionA built-in operator or any stringGive a switch a default branch. BuiltInFilterOperator is the closed set.
Column filter keysfilterOperators, filterMatchfilter: { operators, match }Move the keys into filter.
Filtered empty gridlabels.grid.emptyState ("No rows")labels.grid.noResults ("No results")To keep "No rows", set labels.grid.noResults.
operatorsForColumnA DataGridFilterMenu propRemovedSet filter.operators on the column.
toggleSorttoggleSort(id, true)toggleSort(id, { additive: true })Pass an options object.
Sort or filter on an unknown columnA filter matches no rowDroppedFix the column id.
Equal sort or filter specFires the callbackNo callbackRefetch yourself.
Set operators with a custom matchWith filterMatch, a text or untyped column drops the set operators and the header filter.Every column keeps them, and the built-in match runs them.To run your match for them, list isAnyOf and isNoneOf in filter.operators.
viewIndex of a grouped gridHolds data indexes onlyHolds an entry below 0 for each group row. rowIdAtViewRow answers the group id.Read a row through dataIndexAt. A grid without groupBy is unchanged.

Selection and row actions

Change1.32.0What to change
Checked row memorykeepCheckedRows, keepHiddenCheckedRowscheckedRowsLifetimeMap the props with the table below.
Checkbox stateA cell range, such as Ctrl+A, checks the markers.The checkboxes, aria-selected, and the count read the checked rows. Ctrl+A selects cells.Call setAllRowsChecked(true) to check every row.
Row action argumentsdeleteRows([4]), duplicateRows([4]), deleteRowsById(ids), setRowSelected(4, true), setAllRowsSelecteddeleteRowsAt([4]), duplicateRowsAt([4]), deleteRows(ids), setRowCheckedAt(4, true), setAllRowsCheckedRename the calls. setRowChecked(rowId, checked) takes a row id.
Row actions over unloaded rowsRun over the holesDo nothing in a scroll-mode gridDelete known rows with deleteRows(ids).
enableRowReorderTurns off the row dragRemoved. A reorder family rowMarkers mode arms the drag.Use a plain mode, such as rowMarkers="checkbox".
Checked rows with a checkbox marker'until-click''until-cleared'Set checkedRowsLifetime="until-click".
Header click with totalRowCountSelects the columnSortsSet headerClickBehavior="select".
selectAllMatching()Returns nothing, warns without totalRowCountReturns { ok, reason }, works on client gridsRead the result instead of the warning.
Row move under sortMode="server" with a sortMoves the loaded rowsDoes nothing, reason "view-ordered"Clear the sort before a move.

The props of 1.3 map to checkedRowsLifetime like this:

1.3 props2.0 prop
neitherthe default: 'until-click', or 'across-filters' with totalRowCount
keepCheckedRowscheckedRowsLifetime="until-cleared"
keepCheckedRows and keepHiddenCheckedRowscheckedRowsLifetime="across-filters"
keepHiddenCheckedRows aloneDelete it. It had no effect.

Editing and validation

Change1.32.0What to change
Callback errorsCallbacks rethrowA throw goes to reportErrorCatch in the callback.
updateCells sourceDefaults to "stream"RequiredPass { source: "stream" }.
Second insert or deleteIgnored, "gate-pending"Aborts the pending oneDrop that check.
Two plugins, one command nameThe later plugin winsThe first plugin keeps itOrder the plugins, or define the command in commands.
Edit gateonEditStart(cell)onBeforeEditStart(cell, { signal })Rename the prop.
Soft validationonInvalid: "warn"validationMode: "warn"Rename the column option.
Bulk writes on "warn" columnsPaste, fill, and import drop invalid valuesThey keep the values and flag them in cellErrorsTo drop them, use "block" or processPaste.
Delete and CutEmpties a required cellRun validate on the empty value under "block"To allow it, accept the empty value in validate.
Number textabc clears the cell. 1,234 stores 1.234.The cell keeps its value, and the grid reports the text.Clean the text before a paste or an import.
Select textText that matches no choice empties the cellThe cell keeps its value, and the grid reports the textTo empty the cell, return null for the text from processCellFromClipboard.
CellEditorPropsonChange(value) then commit(movement)Also commitValue(value, movement)Pass commitValue where you build editor props yourself, such as a test.
Column validate with a type validateThe column rule replaces the type ruleThe type rule runs first, then the column ruleTo allow longer longText, raise options.maxLength.
Column locale without a formatNo effectGrouped digits for number, the medium date style for dateTo keep the raw display, remove locale.
Fill gateonFill({ target, preventDefault })processFill({ target, cells }) returns the cells or falseReturn false to cancel. Return cells to write.
pasteFromClipboard result"empty" for a paste that does not start"refused". "empty" means no text.Handle "refused".
cut() resultClears the cells while an editor is open"refused" while an editor is openHandle "refused".
Cut sourcesource: "delete"source: "cut"Check "cut" next to "delete". Add it to a custom recordSources.
sanitizeClipboardFormulasDefault false: a copy keeps =SUM(A1)Default true: a copy writes '=SUM(A1)To copy raw text, set sanitizeClipboardFormulas={false}.
Clipboard failure labelspasteBlocked and clipboardFailed are stringsA string or a function of the modifier nameHandle both forms where you read them.
canUndo, canRedotrue on a readOnly grid with entriesfalse while readOnlyDelete a readOnly || guard.
DataGridApi writesapi.startEditing, api.stopEditing, api.setSelectionapi.actions.startEditing, api.actions.cancelEditing, api.actions.setSelectionCall the writes through api.actions.

Columns and styling

Change1.32.0What to change
Pin values"left", "right", pin-left, data-pinned="left""start", "end", pin-start, data-pinned="start"Rename. Saved layouts with the old values still load.
Pin shadow hooksdata-grid-pin-shadow="left", data-scrolled-left, --grid-pin-shadow-left-x"start", data-scrolled-start, --grid-pin-shadow-start-x, and the end formsRename the CSS selectors.
Def pin and hiddenEach columns array applies them againThey apply at the first appearance of the column id. A later change warns in development.Use setColumnPin, setColumnHidden, or columnLayout.
Width actionssetColumnWidth (drag write), commitColumnWidthpreviewColumnWidth (drag write), setColumnWidth (commit)Rename both calls.
Cell alignmentalign: "left" | "right" | "center", <CellSpan align>align: "start" | "center" | "end". CellSpan inherits it.Use the logical values. Delete the CellSpan prop.
Node header sort arrowA node header draws no arrow of its ownEvery header shows the arrow while its column is sortedSet sortIndicator: false on the column, or remove the DataGridSortIndicator in the header.
Cell z-indexAn unpinned cell has none, so a z-* class stacks itEvery body cell has an integer z-indexRender content that covers other cells in a portal.
text placeholderAn option that nothing readRemoved. longText keeps it.Delete it from text columns.
Number and date languageoptions.locale on each column, status bar localelocale on DataGrid or DataGridProviderSet locale once on the grid.

Keyboard

Change1.32.0What to change
Add-on actionsundo, redo, fillDown, fillRight, openFind, openFindReplace in the coreEach add-on declares and binds its own actionsFor your own command, declare the name.
commitDown and siblingsKeymap names that change no keyRemovedDelete them from keymap.
Default chordstoggleAllRows: mod+shift+e. openFindReplace: ctrl+h.mod+shift+Enter and shift+alt+EnterTo keep an old chord, bind it in keymap.
DataGridGlobalShortcuts flagsA flag replaces the default setA flag adds to undo and redoFor select all alone, add undo={false} redo={false}.
DataGridGlobalShortcuts bare keyFires page-wideNeeds Ctrl or CmdAdd a keydown listener.
captureFindShortcutA DataGridSearch propThe focusSearch keymap actionWrite keymap={{ focusSearch: [] }} to leave Mod+F to the browser.
Shortcuts dialogDataGridKeybindingsShortcut and your dialog stateuseDataGridKeybindings() returns { plugin, open, close }Pass plugins={[keys.plugin]}. Call keys.open() from a button.

Server data and pagination

Change1.32.0What to change
Scroll rowsuseDataGridLazyRows, DataGridLazyGuarduseDataGridServerRows({ mode: "scroll" })Follow Move the lazy rows.
Row range typeRange from data-grid-lazyRowRange from data-gridRename the import.
Block request startAt onceAfter loadDelayMs (100 ms)For the 1.3 timing, pass loadDelayMs: 0.
Loaded rowsEvery row staysAt most maxLoadedRows (10,000)To keep every row, pass maxLoadedRows: Infinity.
Stream batch sizeNo limit100,000 patches. The rest skip as "limit".Split a bigger batch.
Stream writesSkip read-only grids, columns, and rowsWrite into read-only columns and rows. A call without source is a stream call, but a readOnly grid refuses it.Pass source: "edit" to keep the checks.
reshapeDelayMs of useDataGridServerRowsOff unless set1000 while the spec has a sort or a filterPass reshapeDelayMs: false.
Server pagesuseDataGridPagination server modeuseDataGridServerPagerMove the call. Its options type is UseDataGridServerPagerOptions.
Pagination result{ pageData, controls }, total, reconcilePage{ pageData, pager }, totalRowCount, a pager that clampsRename. Spread pager into DataGridPaginationBar.
URL state partsSort, filters, and search textSort onlyTo keep filters and search text in the URL, pass spec={["sort", "filter", "search"]}.
URL page size25The first of pageSizeOptions (10)To keep 25, pass defaultPageSize: 25.
URL pagination countThe total optionNo count option. The pager clamps.Delete total.
fetchRows of the query layerResolves RowsAnswerResolves `RowsAnswerGroupsAnswer`

Exports and labels

Change1.32.0What to change
data-grid barrelTwelve hooks and helpersRemoved from the barrelUse the replacements.
Toolbar, io, and keybindings helpersExportedRemoved from the barrelsRemoved exports lists the names.
Pinned row componentsDataGridPinnedRow, DataGridPinnedRowBand in the barrelModule files onlyLet useDataGridPinnedRows render them.
undefined labelRemoves the labelKeeps the defaultSet "" to blank a string label.
Right-click on a blank areaNo menuThe browser menuNothing.

On this page