Skip to content

Row Status

RowStatusPlugin turns boolean columns into status checkboxes. The boolean remains in your source model, while the plugin adds semantic attributes to rendered rows and provides a default strike-through treatment.

Source code
import { defineCustomElements } from '@revolist/revogrid/loader';
import { currentTheme } from '../composables/useRandomData';
import {
createRowStatusColumns,
createRowStatusRows,
ROW_STATUS_PLUGINS,
ROW_STATUS_TREE,
sortCompletedRows,
type RowStatusDemoRow,
} from './row-status-demo.shared';
import './row-status-demo.css';
defineCustomElements();
export function load(parentSelector: string, rows?: RowStatusDemoRow[]) {
const shell = document.createElement('div');
const grid = document.createElement('revo-grid');
const { isDark } = currentTheme();
shell.className = 'row-status-demo-shell';
grid.className = 'row-status-demo cell-border';
grid.dataset.theme = isDark() ? 'dark' : 'light';
grid.columns = createRowStatusColumns();
grid.plugins = ROW_STATUS_PLUGINS;
grid.columnTypes = {};
grid.tree = ROW_STATUS_TREE;
grid.theme = isDark() ? 'darkMaterial' : 'material';
grid.hideAttribution = true;
grid.addEventListener('rowstatuschange', (event) => {
void sortCompletedRows(grid, event);
});
shell.appendChild(grid);
document.querySelector(parentSelector)?.appendChild(shell);
grid.source = createRowStatusRows(rows);
return () => {
grid.remove();
shell.remove();
};
}

Key behavior

  • Status values are ordinary source booleans, so they can be saved, filtered, exported, and sorted.
  • Every status column defines its own row attribute.
  • Multiple status columns work independently.
  • Tree parents cascade changes to descendants and reflect partial completion with an indeterminate checkbox.
  • Completed-row sorting is application policy and stays outside the plugin.

Register the plugin and add rowStatus to a boolean column. Only the strict value true activates the status.

import { RowStatusPlugin } from '@revolist/revogrid-pro';
grid.plugins = [RowStatusPlugin];
grid.columns = [
{
prop: 'done',
name: 'Done',
rowStatus: { attribute: 'data-done' },
},
{ prop: 'task', name: 'Task' },
];
grid.source = [
{ task: 'Write release notes', done: false },
{ task: 'Publish the build', done: true },
];

An active row receives both [data-done] and the common [row-status] attribute. The common attribute drives the built-in strike-through style.

The checkbox cell stays interactive while normal row cells receive the status treatment. Override the CSS variables on the grid when a different presentation is needed:

revo-grid.my-todos {
--revo-row-status-color: #64748b;
--revo-row-status-opacity: 0.7;
--revo-row-status-text-decoration: line-through;
--revo-row-status-checkbox-size: 20px;
--revo-row-status-checkbox-radius: 50%;
}
revo-grid.my-todos .rgRow[data-archived] .rgCell:not(.row-status-cell) {
--revo-row-status-text-decoration: line-through double;
}

Row-status controls are circular by default so they remain visually distinct from regular checkbox editors and row-selection checkboxes. Set --revo-row-status-checkbox-radius to another value if a different treatment is preferred.

Each column uses its own source prop and attribute. A row keeps [row-status] while any configured status is active.

grid.columns = [
{
prop: 'done',
name: 'Done',
rowStatus: { attribute: 'data-done' },
},
{
prop: 'archived',
name: 'Archived',
rowStatus: { attribute: 'data-archived' },
},
{ prop: 'task', name: 'Task' },
];

Add TreeDataPlugin and normal tree configuration. Propagation is isolated per status column.

import { RowStatusPlugin, TreeDataPlugin } from '@revolist/revogrid-pro';
grid.plugins = [TreeDataPlugin, RowStatusPlugin];
grid.tree = {
idField: 'id',
parentIdField: 'parentId',
rootParentId: null,
expandAll: true,
};
grid.columns = [
{ prop: 'done', name: 'Done', rowStatus: { attribute: 'data-done' } },
{ prop: 'task', name: 'Task', tree: true },
];
ActionResult
Check a parentThe parent and every descendant become complete, including collapsed or filtered descendants.
Clear a parentThe parent and every descendant become incomplete.
Complete every childAncestors become complete from the deepest parent to the root.
Complete only some childrenThe parent value remains false and its checkbox renders indeterminate.
Load inconsistent initial valuesThe source is not rewritten; subtree state is displayed and affected ancestors reconcile on the next edit.

Classic grouping works automatically when grid.grouping is configured. Every synthetic group label renders one checkbox for each row-status column; no extra plugin option is required.

grid.plugins = [RowStatusPlugin];
grid.grouping = {
props: ['department', 'team'],
expandedAll: true,
};
grid.columns = [
{ prop: 'done', name: 'Done', rowStatus: { attribute: 'data-done' } },
{
prop: 'archived',
name: 'Archived',
rowStatus: { attribute: 'data-archived' },
},
{ prop: 'task', name: 'Task' },
{ prop: 'department', name: 'Department' },
{ prop: 'team', name: 'Team' },
];
Grouping actionResult
Check a group statusEvery real descendant receives that boolean value, including descendants hidden by collapsed groups or filters.
Edit one childAncestor group checkboxes recompute as checked, unchecked, or indeterminate.
Use multiple statusesEach group checkbox and source prop remains independent.
Sort, filter, or regroupStatus remains attached to the real source model through its original physical index.
Listen for rowstatuschangeOnly real models and application-source indexes are included; synthetic group rows are excluded.

Normal data rows receive the configured attribute directly. Because core grouping headers are synthetic rows rendered through the group-label template, their derived attributes are placed on .row-status-group-label instead. The same [row-status] styling is applied when every descendant is complete for at least one status.

The directly clicked checkbox uses the regular beforeedit and afteredit events. Listen for rowstatuschange when you need the complete hierarchy batch:

grid.addEventListener('rowstatuschange', (event) => {
const { prop, value, physicalIndexes, models } = event.detail;
persistStatusChanges({ prop, value, physicalIndexes, models });
});

Sorting is intentionally configured by the application. Set ascending boolean sorting (false before true) and reapply it after a completed-status batch:

grid.columns = [
{
prop: 'done',
name: 'Done',
sortable: true,
order: 'asc',
rowStatus: { attribute: 'data-done' },
},
{ prop: 'task', name: 'Task', tree: true },
];
grid.addEventListener('rowstatuschange', (event) => {
if (event.detail.prop === 'done') {
void grid.updateColumnSorting({ prop: 'done' }, 'asc', false);
}
});

See the generated RowStatusPlugin API reference for exported types, constants, and the full JSDoc example.