Skip to content

Resolve Remote Batch Conflicts

Start a batch and change the Notebook status to Ready. When you save, the sample server has changed that status to Shipped. Compare the three values, choose which to keep, select Apply, and save again. If you choose the server value for every pending cell, select Refresh grid to reload the data.

The remote pagination batch can return a conflict with a revision and the latest value for each conflicting submitted cell. With the REST adapter, map the server’s authoritative records back to submitted cells using stable record IDs. Keep the selected field and source coordinates from the submitted transaction.

grid.batchEditing = {
remotePagination: true,
commit: rest.batchCommit(
(transaction) => ({
operationId: transaction.operationId,
resourceId: 'orders',
expectedRevision: loadedRevision,
command: transaction.cells.map(({ model, prop, value }) => ({
id: model.id,
field: prop,
value,
})),
}),
{
conflictCells: (
currentValues: Record<string, Record<string, unknown>>,
transaction,
) =>
transaction.cells.flatMap(({ sourceIndex, prop, model }) =>
Object.hasOwn(currentValues[model.id] ?? {}, prop)
? [{ sourceIndex, prop, currentValue: currentValues[model.id][prop] }]
: [],
),
},
),
};

The server should reject the complete write when the expected revision differs and return a conflict receipt with operationId, status: 'conflict', message, revision, and authoritative. Return the receipt as a successful JSON response so the adapter can read the command outcome. The adapter adds the reviewed revision to the next request automatically. A rebased draft gets a fresh operation ID. Retrying the same unchanged draft reuses its ID.

For an endpoint that returns HTTP 409, use a custom commit callback to parse that response and return a BatchEditConflictReceipt with status, revision, and cells.

The standard batch controls display the original, pending, and server values. Each conflict defaults to Keep. Review the choices and select Apply to confirm them. Pending changes outside the comparison stay in the draft. If every pending value is replaced by a server value, select Refresh grid to reload the page of data. For custom controls, inspect getState().conflict and call resolveConflict(operationId, choices) before committing. Reapplying the draft requires the same loaded page. Finish the rebased save before staging new edits. Structural insert and delete conflicts use the host’s ordinary batch rejection workflow.

Review opens on Conflicts. Switch to Pending changes to inspect the whole draft, then return to Conflicts to continue reviewing your choices.

To customize the review labels, pass reviewViews, reviewPending, and reviewConflicts in the translations argument of defineBatchEditingControls. Use conflictKeep, conflictDiscard, and conflictApply for the dropdown and button.

REST grid adapter