Batch Editing
Start a batch, double-click a cell, and press Enter to stage the edit. The cell shows the new value with a highlight while the edit is pending. Open the pending-changes button to compare values. Select Revert beside an edit to restore that cell, Save to commit the batch, or Cancel to discard the entire batch.
To try batch history, edit two cells and select Save. Select Undo once to restore both original values, then Redo to reapply both edits.
Register BatchEditingPlugin to collect cell edits, clipboard paste, range edits, and row editor saves before updating your data. The packaged data-grid context menu also stages insert, duplicate, and delete commands against the authored row source while a batch is open.
import { BatchEditingPlugin } from '@revolist/revogrid-pro';
grid.plugins = [...grid.plugins, BatchEditingPlugin];grid.batchEditing = { async commit(transaction, signal) { const response = await fetch('/api/grid/changes', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(transaction), signal, }); return response.ok; },};The controls provide Start, Save, Cancel, and a pending-change preview. Paste stages values in existing rows. Use the row commands or stageInsert() to stage additional rows. Pass translations as the fourth argument of defineBatchEditingControls. Hosts can also use begin(), stage(), stageInsert(), stageDelete(), commit(), and cancel() directly. Use getState() or the batcheditstatechange event to build other controls.
Cell changes and deletions use current visible row coordinates when staged. Insertion positions and the host transaction use authored source indexes. The transaction includes an operation ID for safe retries, each target row’s model, changed cells with previous values, and proposed inserts and deletes. Apply all changes atomically on the server. Supply stable row IDs on your models when the server needs them.
Column validation runs before the optional asynchronous validate and commit callbacks. Returning false or throwing retains the draft. Changing the authored source during a save prevents the acknowledged draft from overwriting the refreshed grid. Let the callback complete before reloading the grid.
An accepted batch becomes one local History entry. An application that persists batches remotely should also coordinate remote undo/redo through History’s replay preparation API. Use a host-owned row source for local batch editing.
For remote paging, set grid.batchEditing.remotePagination = true and provide a commit callback. Staging uses the loaded main viewport. The transaction reports offsets in the page’s query results. Map each cell change or deletion to a stable record identifier from its model. The plugin invalidates cached reads and reloads the active page after the server accepts a batch. Remote acceptance does not create a local History entry. If the reload fails, reload the page to see the committed records.
Other server-side row models and tree views use their own mutation workflows.
Continue with Bulk Update Selected Rows or Resolve Remote Batch Conflicts.