Skip to content

Choose actions and allow edits

Start with filtering and sorting. Add more capabilities only when your application needs them. An action is a named operation the assistant can request, such as selecting records or updating a cell. The application decides which actions are available.

The snippets on this page extend the quick-start configuration; interpret is your configured interpreter.

Only configured actions are advertised to the interpreter. Missing required plugins are not silently replaced with custom implementations.

CapabilityConfigurationExecution and boundary
Filter and sortDefaultComposes canonical filter AST and sort criteria.
Column metadata, navigation, layout and groupinggridActions: {}Existing grid APIs; local grouping is omitted with a remote executor.
Read, find and aggregate local rowsgridActions: { readRows: true }Explicit bounded reads of disclosed fields. Results initially stay in the host UI.
Checkbox row selectiongridActions: { rowKey: 'id' }Stable explicit record IDs and installed RowSelectPlugin; does not disclose cell values.
Cell updates and row add/duplicate/deletedataActions and HistoryPluginLocal preview, explicit Apply/Cancel, native validation and undo/redo.
Column add/remove/changeschemaActions and HistoryPluginApproved host column presets; preview before Apply.
Formulas, import/export, charts or backend workintegrations or custom actionsHost-owned recipes and permissions.
Native Pivot, Gantt, Scheduler and Kanban operationsProduct adapter in actionsUses the mounted product’s existing owner and permission model.
Questions and clarificationInterpreter returns answer or clarificationNo grid mutation. The model needs explicit evidence to answer data questions.
Remember previous turnsconversationBounded prompts and visible summaries sent with subsequent requests.
Answer from an action resultanswerFromActionOne additional answer-only call, using explicitly projected evidence.

gridActions.enabled optionally limits the registry. Available names are grid.inspect, grid.read, grid.find, grid.aggregate, grid.focus, grid.select, grid.highlight, grid.selectRecords, columns.visibility, columns.move, columns.resize, columns.pin, columns.autosize, grouping.set and grouping.expand.

Visibility uses ColumnHidePlugin, autosizing uses AutoSizeColumnPlugin, highlighting uses CellFlashPlugin, and record selection uses RowSelectPlugin. These actions are advertised only when their owner is available. Coordinates are zero-based positions in the current visible view, including group rows; they are not stable record IDs. Column moves currently require flat headers and stay within one pinned area.

grid.aggregate supports sum/count/average/min/max on the expanded visible local view. It excludes collapsed descendants and cannot provide full remote-dataset totals. Count excludes null/missing values. Limits are 50,000 scanned positions, ten measures, two grouping fields, 50 groups and 16 KiB output. Exceeding a limit fails rather than silently returning partial totals. Use your server’s analytical owner for complete remote data.

Safe edits: preview, approve, apply Preparing an edit does not mutate data. The user reviews a preview, then applies or cancels. The data owner rechecks permissions, versions and cancellation before committing. Undo is available only when the owner supports it. User Reviews the change Assistant Browser Data owner Grid or your service History When supported Request an edit Prepare + validate No data changes Bounded preview Review proposed changes Apply or Cancel Apply: recheck permission, version and cancellation Commit; record history when supported Undo through the same owner, when supported Cancel or stale request → no commit
Preparation does not change data. Apply rechecks the current state and permissions; Cancel commits nothing. Custom services own their authorization, commit and undo behavior.
import { HistoryPlugin } from '@revolist/revogrid-pro';
// Include HistoryPlugin in grid.plugins alongside the other installed plugins.
grid.aiAssistant = {
interpret,
dataActions: {
rowKey: 'id',
maxRows: 100,
createRow: ({ source, values }) => ({
...source, ...values, id: crypto.randomUUID(),
}),
canMutate: ({ before }) => before?.locked !== true,
},
schemaActions: {
protectedColumns: ['customerId'],
presets: [{
id: 'tax',
description: 'Add the approved tax column',
column: { prop: 'tax', name: 'Tax', filter: 'number' },
}],
},
};

cells.update, rows.duplicate and rows.delete select authored records by stable string/number IDs or a filter AST, never by visible row coordinates. rows.add and duplication require the host’s createRow factory. Data actions check readonly rules, strict validators and canMutate during preparation and again before Apply. No partial batch commits. They support scalar values and are bounded to 100 affected rows by default, 1,000 maximum; remote/tree source owners require custom actions. Factories must be side-effect free during preparation.

Schema actions are columns.add/columns.change using an approved preset ID, and columns.remove using a field ID. Definitions and callbacks stay local. Removing a definition retains row values; changing it does not convert data. The row key, protected columns and excluded fields remain protected.

Data/schema edits use existing grid History. Filter/sort steps, Restore and Reset are a separate history of view criteria. Layout changes persist independently. Effective schema changes refresh the disclosed fields and begin a new view-history baseline.

Next: Control what the model receives.