Skip to content

Editable Controls

Browse these live examples and open Code to inspect their configuration.

Use createAssigneeAvatarColumnType to show assigned people as overlapping avatars with an overflow count and a button that opens the existing assignee picker. Supply the resource list and localized button and overflow labels. Each cell stores an array of { value, units } assignments. The button is omitted in read-only cells. Replace the resource source array when its contents change so cached avatar details update. Try createAssigneeAvatarColumnType in the examples above.

import { createAssigneeAvatarColumnType } from '@revolist/revogrid-pro';
grid.columnTypes = {
assignees: createAssigneeAvatarColumnType({
source: [{ value: 'ada', label: 'Ada', avatarUrl: '/ada.png' }],
maxVisible: 3,
addLabel: 'Edit assignees',
overflowLabel: (count) => `${count} more assignees`,
}),
};
grid.columns = [
{ prop: 'assigned', name: 'Assigned', columnType: 'assignees' },
];
grid.source = [{ assigned: [{ value: 'ada', units: 0 }] }];

For a completion ring beside its value, use completionRenderer with a completion.format callback, a localized completion.missing placeholder, and optional thresholds. See the progress and targets examples for completion rings.

Use createSwitchColumnType for a switch that edits the cell immediately through the grid’s normal edit events. The label callback supplies a localized accessible name for each row. Boolean values work by default; use state and nextValue for other storage formats or an amber review state. Read-only grid and column settings disable editing. Try createSwitchColumnType in the examples above.

import { createSwitchColumnType } from '@revolist/revogrid-pro';
grid.columnTypes = {
access: createSwitchColumnType({
label: (_value, row, column) => `${column.name} access for ${row.name}`,
state: (value) =>
value === 'review' ? 'review' : value === 'granted' ? 'on' : 'off',
nextValue: (_value, checked) => (checked ? 'granted' : 'none'),
}),
};
grid.columns = [{ prop: 'settings', name: 'Settings', columnType: 'access' }];
grid.source = [{ name: 'Sam', settings: 'review' }];

The review state appears checked and uses --rv-switch-column-review-color for its track. nextValue controls the value saved after a click, so applications can decide how review transitions work.

Use createStatusColumnType when each row has a single status that people can edit. It combines the compact not-started, pending, passed and failed icons with the shared dropdown editor. Supply your own stored values and localized labels; the icon is presentation only.

import { createStatusColumnType } from '@revolist/revogrid-pro';
grid.columnTypes = {
status: createStatusColumnType({
editorAriaLabel: 'Inspection status',
options: [
{ value: 'not-started', label: 'Not started', icon: 'not-started' },
{ value: 'pending', label: 'Pending', icon: 'pending' },
{ value: 'passed', label: 'Passed', icon: 'passed' },
{ value: 'failed', label: 'Failed', icon: 'failed' },
],
}),
};
grid.columns = [
{ prop: 'inspection', name: 'Inspection', columnType: 'status' },
];
grid.source = [{ inspection: 'pending' }];

Open a cell for editing to choose a status. An unknown value remains visible as text, and column or grid readonly settings prevent edits. Use disabled: true on an option to make it unavailable.